I have a group where when clicking it puts a bomb the problem that puts one bomb after another and I only want to put only one bomb every x minute
class Bomb extends Phaser.Physics.Arcade.Group {
constructor(physicsWorld, scene) {
super(physicsWorld, scene)
}
newBomb(x, y){
let bomb = this.create(x, y, 'bomb')
if(bomb){
bomb.setActive(true)
bomb.setVisible(true)
bomb.setImmovable(true)
bomb.setOrigin(0)
setTimeout(()=> {
bomb.disableBody(true, true)
console.log('BOOM!')
}, 3000)
}
}
}
export default Bomb