]> git.jsancho.org Git - gacela.git/blobdiff - src/gacela.scm
Adjustments for running games from emacs or shell.
[gacela.git] / src / gacela.scm
index e3bead656de5f701349786b67395cff66fa7896b..d027cfa37b8c360bbfcdeb28d97a74f979a3d974 100644 (file)
@@ -33,6 +33,7 @@
            init-gacela
            quit-gacela
            game-loop
+           gacela-script
            game-running?
            set-game-code
            show-mob-hash
            (game-loop)))))
 
 (define (init-gacela)
-  (set! game-loop-thread (call-with-new-thread (lambda () (game))))
+  (hide-all-mobs)
+  (set-game-code (lambda () #f))
+  (cond ((not game-loop-thread)
+        (set! game-loop-thread (call-with-new-thread (lambda () (game))))))
   (while (not loop-flag))
   #t)
 
 (define (quit-gacela)
+  (hide-all-mobs)
+  (set-game-code (lambda () #f))
   (set! game-loop-thread #f)
   (set! loop-flag #f))
 
                (delay-frame))))
   (quit-video))
 
+(define (gacela-script args)
+  (while loop-flag (sleep 1)))
+
 (define (game-running?)
   loop-flag)