Draw player dead sprite.

This commit is contained in:
David Thompson 2024-05-22 18:21:45 -04:00
parent 9b88cb19c0
commit 2dc354229d
2 changed files with 14 additions and 10 deletions

View file

@ -443,7 +443,7 @@
(('exit obj grid-info) #f)
(('wire-state grid-info) #f)
(('alive?) ($ alive?))
(('describe) `(player ,($ position)))
(('describe) `(player ,($ position), ($ alive?)))
(('collide other offset grid-info)
(define (reverse-move)
(match ($ position)
@ -641,11 +641,8 @@
(match-lambda*
(('tick) (tick))
(('describe)
(let ((player ($ player))
(obj-descs (map (lambda (obj) ($ obj 'describe)) ($ objects))))
(if ($ player 'alive?)
(cons ($ player 'describe) obj-descs)
obj-descs)))
(cons ($ ($ player) 'describe)
(map (lambda (obj) ($ obj 'describe)) ($ objects))))
(('add-object obj)
(if (eq? ($ obj 'type) 'player)
($ player obj)