From 5523027f6369e9ec3f990144e8ef2cd4f243476e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 10 Jan 2014 07:45:41 -0500 Subject: Update some of the example programs to use the new API. * 2d/examples/common.scm: New file. * 2d/examples/coroutine.scm: Updated. * 2d/examples/font.scm: Updated. * 2d/examples/simple.scm: Updated. * 2d/examples/tilemap.scm: Updated. --- examples/tilemap.scm | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'examples/tilemap.scm') diff --git a/examples/tilemap.scm b/examples/tilemap.scm index 011136d..6b024c7 100644 --- a/examples/tilemap.scm +++ b/examples/tilemap.scm @@ -2,11 +2,13 @@ (srfi srfi-9) (srfi srfi-42) (2d game) - (2d scene) (2d sprite) (2d texture) (2d tileset) - (2d vector2)) + (2d vector2) + (2d window)) + +(load "common.scm") ;;; ;;; Orthogonal tile map example @@ -82,15 +84,9 @@ tileset map-tiles)))) -(define tilemap-scene - (make-scene - "Tilemap" - #:init build-map - #:draw draw-map-layer)) +(define layer (build-map)) -(define tilemap - (make-game - #:title "Tilemap" - #:first-scene tilemap-scene)) +(add-hook! draw-hook (lambda (dt alpha) (draw-map-layer layer))) -(run-game tilemap) +(with-window (make-window #:title "Tilemap") + (run-game-loop)) -- cgit v1.2.3