Add bombs and explodable bricks

This commit is contained in:
Juliana Sims 2024-05-24 12:46:15 -04:00
parent 23f034a868
commit feb5b8f3d6
No known key found for this signature in database
GPG key ID: 2A00BD4B0090029E
6 changed files with 86 additions and 2 deletions

View file

@ -365,6 +365,10 @@
(_ (draw-tile context tileset 3 x y)))
(draw-wire-state pos type)))
(define (draw-brick pos exploding?)
;; TODO use exploding for different sprite?
(draw-tile context tileset 22 (vec2-x pos) (vec2-y pos)))
(define (draw-clock-emitter pos)
(draw-tile context tileset 48 (vec2-x pos) (vec2-y pos)))
@ -374,6 +378,9 @@
(define (draw-floor-switch pos on?)
(draw-tile context tileset (if on? 25 24) (vec2-x pos) (vec2-y pos)))
(define (draw-bomb pos exploding?)
(draw-tile context tileset (if exploding? 51 50) (vec2-x pos) (vec2-y pos)))
(define (draw-gem pos)
(draw-tile context tileset 28 (vec2-x pos) (vec2-y pos)))
@ -410,9 +417,11 @@
(('exit pos) #t) ; drawn via background
(('wall pos type) (draw-wall pos type))
(('block pos type) (draw-block pos type))
(('brick pos exploding?) (draw-brick pos exploding?))
(('clock-emitter pos) (draw-clock-emitter pos))
(('switched-emitter pos on?) (draw-switched-emitter pos on?))
(('floor-switch pos on?) (draw-floor-switch pos on?))
(('bomb pos exploding?) (draw-bomb pos exploding?))
(('gem pos) (draw-gem pos))
(('ghost-gem pos) (draw-ghost-gem pos))
(('gate pos open?) (draw-gate pos open?))