summaryrefslogtreecommitdiff
path: root/examples/2048
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-04-05 21:17:35 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-04-05 21:17:35 -0400
commitc2d467c6e7539548366c14606569d181abdc1d4b (patch)
tree64a487a4a9d718a26705128e9d33b07a74b30788 /examples/2048
parent3f8a886eee2de1cc40c36c360c89b0907992e751 (diff)
examples: Use null-model.
* examples/2048/2048.scm: Use null-model * examples/mines/mines.scm: Likewise.
Diffstat (limited to 'examples/2048')
-rwxr-xr-xexamples/2048/2048.scm28
1 files changed, 13 insertions, 15 deletions
diff --git a/examples/2048/2048.scm b/examples/2048/2048.scm
index b5efd34..2b520ac 100755
--- a/examples/2048/2048.scm
+++ b/examples/2048/2048.scm
@@ -322,15 +322,14 @@
(h (texture-height tile-texture))
(label (assoc-ref tile-label-cache n))
(label-color (tile-text-color n))
- (bg-color (tile-bg-color n)))
- (chain `(,(model-paint bg-color tile-sprite)
- ,@(if (zero? n)
- '()
- (list (chain label
- (model-paint label-color)
- (model-move (vector2 (/ w 2) (/ h 2)))))))
- (list->model)
- (model-move (vector2 (* x w) (* y h))))))
+ (bg-color (tile-bg-color n))
+ (tile (model-group (model-paint bg-color tile-sprite)
+ (if (zero? n)
+ null-model
+ (chain label
+ (model-paint label-color)
+ (model-move (vector2 (/ w 2) (/ h 2))))))))
+ (model-move (vector2 (* x w) (* y h)) tile)))
(define window-width 640)
(define window-height 480)
@@ -373,12 +372,11 @@
((board-lose? board) game-over)
((board-win? board) you-win)
(else #f))))
- (chain (if message
- (list message play-again)
- '())
- (list->model)
- (model-move (vector2 (/ board-width 2)
- (/ board-height 2))))))
+ (if message
+ (model-move (vector2 (/ board-width 2)
+ (/ board-height 2))
+ (model-group message play-again))
+ null-model)))
board)))
(define instruction-font (load-default-font 16))