Two-state doodads (global ON/OFF messages) #14

Closed
opened 2019-07-15 17:41:38 +00:00 by kirsle · 1 comment
Owner

This is an idea how to add a global two-state ON/OFF set of doodads for levels, similar to the two-state blocks in Mario Maker 2 or the blue switches on Chip's Challenge.

Currently, we have switches that can toggle doors open and closed but the map editor must link these together manually. The two-state doodads instead should work globally, where the ON/OFF switch should toggle the state of ALL two-state doodads without needing to be manually linked up.

Pub/Sub Broadcast

To implement the global messaging without manually linking the doodads, add a new method to the Message API for the Doodad scripts:

Message.Broadcast("name", args...)

It will be like Message.Publish() but sends the message to ALL doodads whether they're linked to the publisher or not.

On the recipient side, they will Message.Subscribe("name", func) as always.

This is an idea how to add a global two-state ON/OFF set of doodads for levels, similar to the two-state blocks in _Mario Maker 2_ or the blue switches on _Chip's Challenge._ Currently, we have switches that can toggle doors open and closed but the map editor must link these together manually. The two-state doodads instead should work globally, where the ON/OFF switch should toggle the state of ALL two-state doodads without needing to be manually linked up. ## Pub/Sub Broadcast To implement the global messaging without manually linking the doodads, add a new method to the `Message` API for the Doodad scripts: ```javascript Message.Broadcast("name", args...) ``` It will be like `Message.Publish()` but sends the message to ALL doodads whether they're linked to the publisher or not. On the recipient side, they will `Message.Subscribe("name", func)` as always.
kirsle added the
doodad
label 2019-07-15 17:41:38 +00:00
Author
Owner

Implemented in 8965a7d86a

Implemented in 8965a7d86a4e25ee30e94aa66a760113302af702
kirsle added this to the First Beta Release MVP milestone 2019-12-31 02:41:40 +00:00
Sign in to join this conversation.
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: SketchyMaze/doodle#14
No description provided.