stomp
Permet à un objet d'infliger des dégats aux personnages sur lesquels il tombe
triggers on self
"stomp"parameters
| Parameter | Default Value | Type | Description |
|---|---|---|---|
tag | string | "alive" |
example
stomp({ tag: "alive"}),function stomp(p) { const param = { tag: "alive", ...p } return { id: "stomp", add() { this.onCollide(param.tag, (obj, col) => this.checkDangerColission(obj, col)) }, checkDangerColission(obj, col) { if (obj.isGrounded() && col.isBottom()) { obj.trigger("hit", obj.hp()) this.trigger("stomp") } }, }}