Add level progression.

This commit is contained in:
David Thompson 2024-05-20 13:34:59 -04:00
parent 99d7643c47
commit ce0c002e8b
8 changed files with 211 additions and 41 deletions

View file

@ -550,7 +550,8 @@ the default ORIENTATION value of 'orthogonal' is supported."
(define obj:player-spawn 3)
(define obj:exit 4)
(define obj:block:copper 5)
(define obj:clock-emitter 6)
(define obj:block:crate 6)
(define obj:clock-emitter 7)
(define (compile-environment-layer tile-map layer-name)
(let ((tw (tile-map-tile-width tile-map))
@ -582,13 +583,14 @@ the default ORIENTATION value of 'orthogonal' is supported."
(append-map (lambda (obj)
(let* ((type (map-object-type obj))
(properties (map-object-properties obj))
(r (map-object-shape obj))
(r (pk 'obj type (map-object-shape obj)))
(x (/ (rect-x r) tw))
(y (/ (rect-y r) th)))
(match type
('player-spawn (list x y obj:player-spawn))
('block
(match (assq-ref properties 'kind)
("crate" (list x y obj:block:crate))
("copper" (list x y obj:block:copper))
(kind (error "unsupported block kind" kind))))
(_ (error "unsupported object type" type)))))