From d1ecb21fca03cdd0e9360a4f1b88c7e05a9354e2 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 3 Nov 2013 17:37:43 -0500 Subject: Export scene type tag. --- examples/animation.scm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'examples/animation.scm') 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) -- cgit v1.2.3