Noah Petherbridge
99eab19c5b
* Implement the pub/sub message passing system that lets the JavaScript VM of one actor (say, a Button) send messages to other linked actors in the level (say, an Electric Door) * Buttons now emit a "power(true)" message while pressed and "power(false)" when released. Sticky Buttons do not release and so do not send the power(false) message. * Electric Doors listen for the "power" event and open or close themselves based on the boolean value received. * If a Sticky Button receives power and is currently pressed down, it will pop back up (reset to "off" position) and notify its linked actors that they have lost power too. So if a Sticky Button held an Electric Door open, and another Button powers the Sticky Button, it would pop back up and also close the Electric Door. |
||
---|---|---|
.. | ||
blue-key.png | ||
blue1.png | ||
blue2.png | ||
electric-door.js | ||
electric1.png | ||
electric2.png | ||
electric3.png | ||
electric4.png | ||
green-key.png | ||
green1.png | ||
green2.png | ||
keys.js | ||
locked-door.js | ||
README.md | ||
red-key.png | ||
red1.png | ||
red2.png | ||
yellow-key.png | ||
yellow1.png | ||
yellow2.png |
Button Doodads
doodad convert -t "Red Door" red1.png red2.png red-door.doodad
doodad convert -t "Blue Door" blue1.png blue2.png blue-door.doodad
doodad convert -t "Green Door" green1.png green2.png green-door.doodad
doodad convert -t "Yellow Door" yellow1.png yellow2.png yellow-door.doodad
doodad convert -t "Red Key" red-key.png red-key.doodad
doodad convert -t "Blue Key" blue-key.png blue-key.doodad
doodad convert -t "Green Key" green-key.png green-key.doodad
doodad convert -t "Yellow Key" yellow-key.png yellow-key.doodad
doodad convert -t "Electric Door" electric{1,2,3,4}.png electric-door.doodad