Function

trigger

(event: string, tag: string, args: any): void

Trigger an event on all game objs with certain tag.

param event- The tag to trigger to.

param tag- Arguments to pass to the `on()` functions

trigger("shoot", "target", 140);

on("shoot", "target", (obj, score) => {
    obj.destroy();
    debug.log(140); // every bomb was 140 score points!
});

since v3001.0.6

group Events

experimental This feature is in experimental phase, it will be fully released in v3001.1.0

kaplay logo

Layer

Miscalenous