Add basic AND gate and electric switch.

This commit is contained in:
David Thompson 2024-05-22 08:00:39 -04:00
parent ff242fd1a5
commit 5756844161
5 changed files with 105 additions and 23 deletions

View file

@ -42,9 +42,14 @@
(spawn ^floor-switch x y target-x target-y)))
(9 (and spawn-gem? (spawn ^gem x y)))
(10 (spawn ^gate x y))
(11 (spawn ^and-gate x y))
(12 (let ((target-x (bytevector-u8-ref objects (+ i 3)))
(target-y (bytevector-u8-ref objects (+ i 4))))
(spawn ^electric-switch x y target-x target-y)))
(id (error "invalid level object" id))))
(i* (+ i (match id
(8 5) ; floor-switch
;; floor-switch or electric-switch
((or 8 12) 5)
(_ 3)))))
(when obj
($ level* 'add-object obj))