diff options
| author | Gene Pasquet <dev@etenil.net> | 2026-04-18 02:47:10 +0100 |
|---|---|---|
| committer | Gene Pasquet <dev@etenil.net> | 2026-04-18 02:47:10 +0100 |
| commit | 38eee24832fe6da4f135cae455881ab97953b23a (patch) | |
| tree | cffc2bb3b45ac11d90f4a2de3e207f65862fb6fd /demo/sandbox.scm | |
| parent | a02b892e2ad1e1605ff942c63afdd618daa48be4 (diff) | |
Refresh docs and re-indent
Diffstat (limited to 'demo/sandbox.scm')
| -rw-r--r-- | demo/sandbox.scm | 74 |
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*) |
