diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-01-10 07:45:41 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-01-10 07:45:41 -0500 |
commit | 5523027f6369e9ec3f990144e8ef2cd4f243476e (patch) | |
tree | df91f447da824dd5e15f0d86aae9e5ec3d4f0409 /examples/tilemap.scm | |
parent | 6bdd1e305834dcc9be22d9a54d84f025a24d4825 (diff) |
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.
Diffstat (limited to 'examples/tilemap.scm')
-rw-r--r-- | examples/tilemap.scm | 20 |
1 files changed, 8 insertions, 12 deletions
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)) |