]> git.jsancho.org Git - gacela.git/blobdiff - src/gacela.scm
(no commit message)
[gacela.git] / src / gacela.scm
index f70a9c62e826ec75c08d8af9fffdd057a206966b..248f1835ffbbf14201cc579cc958c95db6000e14 100644 (file)
 (define game-running? #f)
 (define set-game-code #f)
 
-(let ((running #f) (game-code #f))
+(let ((running #f) (game-code #f) (mobs '()))
   (set! game-loop
        (lambda ()
+         (set! mobs (get-active-mobs))
          (set! running #t)
          (quit? #f)
          (do () ((quit?))
            (process-events)
            (cond ((not (quit?))
                   (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
-;                (to-origin)
-;                (refresh-active-objects)
+                  (to-origin)
+                  (cond ((mobs-changed?) (set! mobs (get-active-mobs))))
                   (if (procedure? game-code) (game-code))
-;                (render-objects)
+                  (process-mobs mobs)
                   (SDL_GL_SwapBuffers)
                   (delay-frame))))
          (set! running #f)))
          (set! game-code game-function))))
 
 (define (quit-game)
-;  (free-all-resources)
    (quit-audio)
    (quit-video-mode)
 ;  (quit-all-mobs)
 ;   (kill-all-objects)
-;  (clear-events)
-;  (quit-events)
+;   (clear-events)
+   (quit-events)
    (quit-sdl))