PrzeGrze

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. Hello, I've been following platformer tutorial so far, and wanted to implement similar stomping behavior to the one on the main page. Once the mainPlayer stomps something, I want the second object to flash for a while and then get removed. I'm using boilerplate 2.3.0 atm and tried to fiddle with me.Timer; onCollision: function (response, other) { if (response.b.body.collisionType !== me.collision.types.WORLD_SHAPE) { // res.y >0 means touched by something on the bottom // which mean at top position for this one if (this.alive && (response.overlapV.y > 0) && response.a.body.falling) { this.renderable.flicker(750); me.timer.setTimeout(me.game.world.removeChild(this), 750) } return false; } // Make all other objects solid return true; } However, enemy entity gets removed directly, and after timeout I face a crash. Seems like the child is undefined in this context. Replacing ```this``` in ```removeChild()``` with ```response.b``` yielded same error. Beats me how to implement stomp mechanic, so I'd like to ask for some pointers and or assistance. Regards