Make bombs movable, update bomb rendering

This commit is contained in:
Juliana Sims 2024-05-24 15:23:34 -04:00
parent 27bc4ea783
commit a102a9fb06
No known key found for this signature in database
GPG key ID: 2A00BD4B0090029E
2 changed files with 61 additions and 37 deletions

View file

@ -296,6 +296,8 @@
(play-sound-effect audio:electric-switch-off))
(('receive-electron x y)
(play-sound-effect audio:warp 0.25))
(('explosion x y)
(pk 'BOOM!))
(_ (values)))
(lp rest))))
(update-objects!)
@ -366,8 +368,7 @@
(_ (draw-tile context tileset 3 x y)))
(draw-wire-state pos type)))
(define (draw-brick pos exploding?)
;; TODO use exploding for different sprite?
(define (draw-brick pos)
(draw-tile context tileset 22 (vec2-x pos) (vec2-y pos)))
(define (draw-clock-emitter pos)
@ -379,8 +380,8 @@
(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-bomb pos countdown)
(draw-tile context tileset (+ 51 countdown) (vec2-x pos) (vec2-y pos)))
(define (draw-gem pos)
(draw-tile context tileset 28 (vec2-x pos) (vec2-y pos)))
@ -418,11 +419,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?))
(('brick pos) (draw-brick pos))
(('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?))
(('bomb pos countdown) (draw-bomb pos countdown))
(('gem pos) (draw-gem pos))
(('ghost-gem pos) (draw-ghost-gem pos))
(('gate pos open?) (draw-gate pos open?))