summaryrefslogtreecommitdiff
path: root/examples/joystick.scm
diff options
context:
space:
mode:
authorDavid Thompson <davet@gnu.org>2015-06-06 20:13:42 -0400
committerDavid Thompson <davet@gnu.org>2015-06-06 20:13:42 -0400
commit57046b0ba98a789fa547ccf56df60458a98e1330 (patch)
treedb1e2edfb83f61e2bc777ac4c71899f288afdd52 /examples/joystick.scm
parent2159664c2a5c71b1e2a4cee4b9dd087fad6aa9a2 (diff)
Update examples to use new interfaces.
Diffstat (limited to 'examples/joystick.scm')
-rw-r--r--examples/joystick.scm10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/joystick.scm b/examples/joystick.scm
index ae090da..43484e3 100644
--- a/examples/joystick.scm
+++ b/examples/joystick.scm
@@ -30,7 +30,8 @@
(sly render model)
(sly render sprite)
(sly render texture)
- (sly render font))
+ (sly render font)
+ (sly render scene))
(load "common.scm")
@@ -63,14 +64,15 @@
(button-caption-signal "This is the other caption" 2)
(button-caption-signal "This is the other other caption" 3))))
-(define-signal scene
+(define-signal model
(signal-map (lambda (position caption)
(model-move position (model-group player caption)))
player-position caption))
(define camera (orthographic-camera (vx resolution) (vy resolution)))
-(add-hook! draw-hook (lambda _ (draw-model (signal-ref scene) camera)))
+(define-signal scene
+ (signal-map (lambda (model) (make-scene camera model)) model))
(add-hook! joystick-axis-hook
(lambda (which axis value)
@@ -89,7 +91,7 @@
(with-window (make-window #:title "Joystick test"
#:resolution resolution)
- (start-game-loop))
+ (start-game-loop scene))
;;; Local Variables:
;;; compile-command: "../pre-inst-env guile joystick.scm"