Add gate and warp sound effects.

This commit is contained in:
David Thompson 2024-05-23 07:48:53 -04:00
parent a24d737bc7
commit d4065aa2bf
4 changed files with 16 additions and 7 deletions

View file

@ -170,7 +170,7 @@
(#f (pk "no switch target!"))
(target
($ grid-info 'append-event `(floor-switch-off ,x ,y))
($ target 'deactivate)))))
($ target 'deactivate grid-info)))))
(('wire-state grid-info) #f)
(('update-wire-state grid-info) #f)
(('alive?) #t)
@ -181,7 +181,7 @@
(#f (pk "no switch target!"))
(target
($ grid-info 'append-event `(floor-switch-on ,x ,y))
($ target 'activate))))))
($ target 'activate grid-info))))))
(define (^electric-switch bcom x y target-x target-y)
(define position (vector x y 0))
@ -205,7 +205,7 @@
(#f (pk "no switch target!"))
(target
($ grid-info 'append-event `(electric-switch-off ,x ,y))
($ target 'deactivate)))))
($ target 'deactivate grid-info)))))
(when (>= ($ grid-info 'wireworld-neighbor-count x y) 1)
($ on? #t)
($ timer 2)
@ -213,7 +213,7 @@
(#f (pk "no switch target!"))
(target
($ grid-info 'append-event `(electric-switch-on ,x ,y))
($ target 'activate))))))
($ target 'activate grid-info))))))
(('alive?) #t)
(('describe) `(electric-switch ,position ,($ on?)))
(('collide other offset grid-info) #f)))
@ -305,9 +305,12 @@
(('post-tick grid-info) #f)
(('enter obj grid-info) #f)
(('exit obj grid-info) #f)
;; TODO: Send grid-info
(('activate) ($ open? #t))
(('deactivate) ($ open? #f))
(('activate grid-info)
($ open? #t)
($ grid-info 'append-event `(gate-open ,x ,y)))
(('deactivate grid-info)
($ open? #f)
($ grid-info 'append-event `(gate-close ,x ,y)))
(('wire-state grid-info) #f)
(('update-wire-state grid-info) #f)
(('alive?) #t)