aboutsummaryrefslogtreecommitdiff
path: root/demo/shmup.scm
diff options
context:
space:
mode:
Diffstat (limited to 'demo/shmup.scm')
-rw-r--r--demo/shmup.scm15
1 files changed, 8 insertions, 7 deletions
diff --git a/demo/shmup.scm b/demo/shmup.scm
index 315069c..15afb71 100644
--- a/demo/shmup.scm
+++ b/demo/shmup.scm
@@ -3,6 +3,7 @@
(chicken random)
(only srfi-1 filter any)
(only srfi-197 chain)
+ (only (list-utils alist) plist->alist)
(prefix sdl2 "sdl2:")
(prefix sdl2-ttf "ttf:")
(prefix sdl2-image "img:")
@@ -27,16 +28,16 @@
;; ── Entity factories ─────────────────────────────────────────────────────────
(define (make-player)
- (list #:type 'player #:x 280 #:y 360
- #:width 16 #:height 16 #:vx 0 #:vy 0))
+ (plist->alist (list #:type 'player #:x 280 #:y 360
+ #:width 16 #:height 16 #:vx 0 #:vy 0)))
(define (make-bullet x y)
- (list #:type 'bullet #:x x #:y y
- #:width 4 #:height 8 #:vx 0 #:vy -6))
+ (plist->alist (list #:type 'bullet #:x x #:y y
+ #:width 4 #:height 8 #:vx 0 #:vy -6)))
(define (make-enemy x)
- (list #:type 'enemy #:x x #:y 0
- #:width 16 #:height 16 #:vx 0 #:vy 2))
+ (plist->alist (list #:type 'enemy #:x x #:y 0
+ #:width 16 #:height 16 #:vx 0 #:vy 2)))
;; ── Collision ────────────────────────────────────────────────────────────────
@@ -79,7 +80,7 @@
(define (update-player player input)
(let ((updated (chain player
(entity-set _ #:vx (player-vx input))
- (apply-velocity-x _ #f 0)
+ (apply-velocity-x #f _ 0)
(clamp-player-x _))))
(when (input-pressed? input 'a)
(play-sound 'shoot))