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

Trigger an event on all game objs with certain tag.

paramevent- The tag to trigger to.

paramtag- 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!
});

sincev3001.0.6

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

kaplay logo

Misc

Layer