From: jsancho Date: Wed, 8 Jun 2011 17:41:14 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=58340d3d589beaca283fe8678ba2d24ad3b069c0;p=gacela.git --- diff --git a/src/gacela_mobs.scm b/src/gacela_mobs.scm index 5d4894c..497e827 100755 --- a/src/gacela_mobs.scm +++ b/src/gacela_mobs.scm @@ -21,7 +21,6 @@ (define kill-mob #f) (define get-active-mobs #f) (define reload-mobs? #f) -(define reload-mobs #f) (let ((active-mobs '(m1 m2)) (reload #f)) (set! add-mob @@ -38,12 +37,22 @@ (lambda () active-mobs)) (set! reload-mobs? - (lambda () reload)) + (lambda () reload))) - (set! reload-mobs - (lambda () - #f))) (define-macro (get-mobs-function) (let ((mobs (get-active-mobs))) `(lambda () ,@(map (lambda (mob) `(,mob)) mobs)))) + +(define-macro (define-mob mob-head . look) + (let ((name (car mob-head)) (attr (cdr mob-head))) + `(begin + (define ,name #f) + (let ((attr ,attr)) + (set! ,name + (lambda (option) + (case option + ((#:render) + (glPushMatrix) + ,@(map (lambda (x) (if (string? x) `(draw-image ,x) x)) look) + (glPopMatrix)))))))))