squish
Permet à un objet d'infliger des dégats aux personnages sur lesquels il tombe
triggers on self
"stomp"triggers on others
"stomped"parameters
| Parameter | Default Value | Type | Description |
|---|---|---|---|
tag | string | '*' | |
groundedDelay | number | 0.0000001 |
example
squish({ tag: '*', groundedDelay: 0.0000001}),function squish(p) { const param = { tag: '*', groundedDelay: 0.0000001, ...p, }; return { id: 'squish', add() { this.onCollideUpdate(param.tag, (obj, col) => { if ( obj.isAlive && obj.has('body') && col.isBottom() && obj.isGrounded() ) { obj.trigger('hit', this.hp); obj.trigger('stomped'); this.trigger('stomp'); } }); }, };}