summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/animation.scm22
1 files changed, 14 insertions, 8 deletions
diff --git a/examples/animation.scm b/examples/animation.scm
index c165568..bf43be9 100644
--- a/examples/animation.scm
+++ b/examples/animation.scm
@@ -1,6 +1,9 @@
(use-modules (2d animation)
(2d game)
+ (2d game-loop)
+ (2d scene)
(2d sprite)
+ (2d stage)
(2d tileset)
(2d vector2)
(2d window))
@@ -23,13 +26,16 @@ sprite out of it."
(make-sprite (demo-animation)
#:position (vector2 320 240)))
-(define-scene demo
- #:title "Demo"
- #:draw (lambda (sprite) (draw-sprite sprite))
- #:state (demo-sprite))
+(define demo-scene
+ (make-scene
+ #:init (lambda ()
+ (stage-define sprite (demo-sprite)))
+ #:draw (lambda ()
+ (draw-sprite (stage-ref sprite)))))
-(define-game animation
- #:title "Animation"
- #:first-scene demo)
+(define animation-demo
+ (make-game
+ #:title "Animation"
+ #:first-scene demo-scene))
-(run-game animation)
+(run-game animation-demo)