What it does
events.emit acts on events: it emits. It takes name and data. data is optional.
Signature
events.emit(name, data?)Arguments
namedataoptional
Example · generated
function start() { events.emit('main');}events.emit is called with values of the shape its signature asks for. The code sits in start(), which the engine calls once, when the entity spawns.