diff options
author | David Thompson <dthompson2@worcester.edu> | 2013-11-03 17:37:43 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2013-11-03 17:37:43 -0500 |
commit | d1ecb21fca03cdd0e9360a4f1b88c7e05a9354e2 (patch) | |
tree | 89390feb1c82902611e45a6f17007c414bf27d73 /examples | |
parent | e3e587806f7268fca5e074322670a2ddb1c1c653 (diff) |
Export scene type tag.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/animation.scm | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/examples/animation.scm b/examples/animation.scm index 92da549..a262d9e 100644 --- a/examples/animation.scm +++ b/examples/animation.scm @@ -8,7 +8,7 @@ (2d vector2) (2d window)) -(define (demo-animation) +(define (make-demo-animation) "Load a texture, split it into 64x64 tiles, and build an animated sprite out of it." (let* ((tiles (load-tileset "images/princess.png" 64 64)) @@ -22,18 +22,17 @@ sprite out of it." (tileset-ref tiles 26)))) (make-animation frames 6 #t))) -(define-stage-variable sprite - (make-sprite (demo-animation) - #:position (vector2 320 240))) - -(define demo-scene +(define animation-scene (make-scene - #:draw (lambda () - (draw-sprite (sprite))))) + "Animation" + #:init (lambda () + (make-sprite (make-demo-animation) + #:position (vector2 320 240))) + #:draw draw-sprite)) (define animation-demo (make-game #:title "Animation" - #:first-scene demo-scene)) + #:first-scene animation-scene)) (run-game animation-demo) |