From cc543831dab097d79fdf8c9b4a55a4b9393ee05d Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 30 Nov 2014 20:35:57 -0500 Subject: examples: Update a few example programs. * examples/2048/2048: Update. * examples/animation.scm: Likewise. * examples/common.scm: Likewise. * examples/simple.scm: Likewise. --- examples/simple.scm | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'examples/simple.scm') diff --git a/examples/simple.scm b/examples/simple.scm index 0fd4503..9560f6f 100644 --- a/examples/simple.scm +++ b/examples/simple.scm @@ -15,34 +15,25 @@ ;;; along with this program. If not, see ;;; . -(use-modules (sly camera) - (sly game) - (sly math rect) - (sly render scene) - (sly render sprite) - (sly math transform) - (sly vector) +(use-modules (sly game) (sly window) - (sly render color)) + (sly math vector) + (sly render camera) + (sly render group) + (sly render sprite)) (load "common.scm") (define scene - (scene-root - (scene-node - (position #(320 240)) - (uniforms `(("color" ,white))) - (children - (list (load-sprite "images/p1_front.png")))))) + (group-move (vector2 320 240) + (group (load-sprite "images/p1_front.png")))) -(define camera - (make-camera scene - identity-transform - (orthographic-projection 0 640 0 480 0 1) - (make-rect 0 0 640 480))) +(define camera (orthographic-camera 640 480)) + +(add-hook! draw-hook (lambda _ (draw-group scene camera))) (with-window (make-window #:title "Simple Sprite Demo") - (start-game-loop camera)) + (start-game-loop)) ;;; Local Variables: ;;; compile-command: "../pre-inst-env guile simple.scm" -- cgit v1.2.3