From 57046b0ba98a789fa547ccf56df60458a98e1330 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 6 Jun 2015 20:13:42 -0400 Subject: Update examples to use new interfaces. --- examples/joystick.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples/joystick.scm') 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" -- cgit v1.2.3