aboutsummaryrefslogtreecommitdiff
path: root/demo/sandbox.scm
diff options
context:
space:
mode:
authorGene Pasquet <dev@etenil.net>2026-04-17 16:30:34 +0100
committerGene Pasquet <dev@etenil.net>2026-04-17 16:30:34 +0100
commit8251c85a4a588504d38a2fad05e4b0fe1cdccb9d (patch)
treec3fcedb7331caf798f2355c7549b35aa3aaf6ac8 /demo/sandbox.scm
parent5de3b9cf122542f2a0c1c906c8ce8add20e5c8c6 (diff)
Convert entities to alists
Diffstat (limited to 'demo/sandbox.scm')
-rw-r--r--demo/sandbox.scm27
1 files changed, 14 insertions, 13 deletions
diff --git a/demo/sandbox.scm b/demo/sandbox.scm
index e23584f..ef71053 100644
--- a/demo/sandbox.scm
+++ b/demo/sandbox.scm
@@ -2,6 +2,7 @@
(chicken base)
(chicken random)
(only srfi-1 iota take)
+ (only (list-utils alist) plist->alist)
(prefix sdl2 "sdl2:")
(prefix sdl2-ttf "ttf:")
(prefix sdl2-image "img:")
@@ -49,12 +50,12 @@
;; ── Entity factories ─────────────────────────────────────────────────────────
(define (make-box x y tw th)
- (list #:type 'box
- #:x x #:y y #:width tw #:height th
- #:vx 0 #:vy 0
- #:gravity? #t #:on-ground? #f
- #:solid? #t #:immovable? #f
- #:tile-id 29))
+ (plist->alist (list #:type 'box
+ #:x x #:y y #:width tw #:height th
+ #:vx 0 #:vy 0
+ #:gravity? #t #:on-ground? #f
+ #:solid? #t #:immovable? #f
+ #:tile-id 29)))
(define (spawn-boxes tw th)
(map (lambda (i)
@@ -64,13 +65,13 @@
(iota 8)))
(define (make-demo-bot x y tw th id)
- (list #:type 'demo-bot
- #:x x #:y y #:width tw #:height th
- #:vx 0 #:vy 0
- #:gravity? #t #:on-ground? #f
- #:solid? #t #:immovable? #f
- #:tile-id 1
- #:demo-id id #:demo-since-jump 0))
+ (plist->alist (list #:type 'demo-bot
+ #:x x #:y y #:width tw #:height th
+ #:vx 0 #:vy 0
+ #:gravity? #t #:on-ground? #f
+ #:solid? #t #:immovable? #f
+ #:tile-id 1
+ #:demo-id id #:demo-since-jump 0)))
;; ── Per-entity intent ───────────────────────────────────────────────────────