I am trying to create a bomb that only goes off after the player has collides with it but delays for a number of seconds. Currently it goes off immediately
I have my collision as below
game.physics.arcade.collide(this.player, this.tnts, this.tntCollision, null, this);
and the collison handler as below
tntCollision: function (player, tnt) {
if (player.body.touching.right){
player.body.velocity.x = -200;
} else if (player.body.touching.down) {
tnt.kill();
var explosionGroup = "explosionSmallGroup";
var explosion = this[explosionGroup].getFirstExists(false);
explosion.reset(tnt.x, tnt.y);
explosion.animations.play('explode', 30, false, true);
} else if (player.body.touching.left) {
player.body.velocity.x = 200;
}
}