Signals namespace is how you broadcast messages between entities in the level. A signal carries an identifier string and optional data payload; any entity that listens for that identifier will receive the signal and can act on it. You choose the delivery scope — all entities, a single target, a tag group, a type group, or entities that pass a custom filter function.
Functions
emit
Dispatches a pre-built Signal object, or constructs one inline from a property table.
emitToAll
Broadcasts a signal to every entity in the level, optionally with a data payload.
emitTo
Sends a signal to a single specific entity.
emitToTag
Sends a signal to every entity that carries the given tag string.
emitToType
Sends a signal to every entity of a given EntityType.
emitToTypeAndTag
Sends a signal to every entity that matches both the given type and tag.
emitToCustom
Sends a signal to every entity for which customFilter(entity, signal) returns true.
Signal Class
You can construct aSignal object manually when you need full control over all delivery options. Pass it to Signals.emit().
Properties
Signal.new
id are optional: