aboutsummaryrefslogtreecommitdiff
path: root/demo/sandbox.scm
diff options
context:
space:
mode:
Diffstat (limited to 'demo/sandbox.scm')
-rw-r--r--demo/sandbox.scm74
1 files changed, 37 insertions, 37 deletions
diff --git a/demo/sandbox.scm b/demo/sandbox.scm
index ef71053..9d6b0fe 100644
--- a/demo/sandbox.scm
+++ b/demo/sandbox.scm
@@ -39,13 +39,13 @@
(map-data (append (map (lambda (_) empty-row) (iota (- nrows 1)))
(list floor-row))))
(make-tilemap
- width: ncols height: nrows
- tilewidth: tw tileheight: th
- tileset-source: "" tileset: ts
- layers: (list (make-layer name: "ground"
- width: ncols height: nrows
- map: map-data))
- objects: '())))
+ width: ncols height: nrows
+ tilewidth: tw tileheight: th
+ tileset-source: "" tileset: ts
+ layers: (list (make-layer name: "ground"
+ width: ncols height: nrows
+ map: map-data))
+ objects: '())))
;; ── Entity factories ─────────────────────────────────────────────────────────
@@ -93,10 +93,10 @@
(x-left (entity-ref origin #:x 0))
(x-right (+ x-left (* 6 tw)))
(tweened (entity-set origin #:tween
- (make-tween origin
- props: `((#:x . ,x-right))
- duration: 3500 ease: 'sine-in-out
- repeat: -1 yoyo?: #t))))
+ (make-tween origin
+ props: `((#:x . ,x-right))
+ duration: 3500 ease: 'sine-in-out
+ repeat: -1 yoyo?: #t))))
(cons tweened (cdr shelf-list))))
(define (make-sandbox-scene game)
@@ -109,41 +109,41 @@
(gh (game-height game))
(tm (make-sandbox-tilemap ts tw th gw gh))
(shelf-list (attach-shelf-tween!
- (instantiate-group-prefab reg 'shelf-platform
- (* 10 tw) (- gh (* 6 th)))
- tw))
+ (instantiate-group-prefab reg 'shelf-platform
+ (* 10 tw) (- gh (* 6 th)))
+ tw))
(raft-list (instantiate-group-prefab reg 'collision-raft
- 120 (- gh (* 14 th))))
+ 120 (- gh (* 14 th))))
(bots (list (make-demo-bot 80 80 tw th 0)
(make-demo-bot 220 60 tw th 1)
(make-demo-bot 380 100 tw th 2))))
(make-scene
- entities: (append shelf-list raft-list (spawn-boxes tw th) bots)
- tilemap: tm
- tileset: #f
- camera: (make-camera x: 0 y: 0)
- tileset-texture: tex
- camera-target: #f
- background: '(32 34 40))))
+ entities: (append shelf-list raft-list (spawn-boxes tw th) bots)
+ tilemap: tm
+ tileset: #f
+ camera: (make-camera x: 0 y: 0)
+ tileset-texture: tex
+ camera-target: #f
+ background: '(32 34 40))))
;; ── Game ─────────────────────────────────────────────────────────────────────
(define *game*
(make-game
- title: "Demo: Physics Sandbox"
- width: +game-width+ height: +game-height+
-
- create: (lambda (game)
- (game-scene-set! game (make-sandbox-scene game)))
-
- update: (lambda (game dt)
- (set! *demo-t* (+ *demo-t* dt))
- (let ((scene (game-scene game)))
- (game-scene-set! game
- (scene-map-entities scene
- (lambda (scene_ e)
- (if (eq? (entity-type e) 'demo-bot)
- (update-demo-bot e dt)
- e))))))))
+ title: "Demo: Physics Sandbox"
+ width: +game-width+ height: +game-height+
+
+ create: (lambda (game)
+ (game-scene-set! game (make-sandbox-scene game)))
+
+ update: (lambda (game dt)
+ (set! *demo-t* (+ *demo-t* dt))
+ (let ((scene (game-scene game)))
+ (game-scene-set! game
+ (scene-map-entities scene
+ (lambda (scene_ e)
+ (if (eq? (entity-type e) 'demo-bot)
+ (update-demo-bot e dt)
+ e))))))))
(game-run! *game*)