Skip to content

@modoki/engine / index / dispatchGameAction

Function: dispatchGameAction()

dispatchGameAction(name, opts?): boolean

Pipeline-SAFE action dispatch — like dispatchUIAction but never throws on a missing handler (warns + returns false), so it's safe to call from inside a system tick / the fixed step. This is the sanctioned way for engine systems to fire game reactions to simulation events (e.g. physics2DSystem dispatching an OnCollision2D action), where dispatchUIAction's dev-throw-on-missing would abort the whole frame (F10). Still inert unless the sim is running. Returns true iff a handler ran.

Parameters

name

string

opts?

DispatchOptions

Returns

boolean

Built with Modoki.