Hi guys,
I am creating a game based on MVC with flash punk. I add 5 enemies per time in the world but when I want to destroy one enemy by a collision with the bullet, all the enemies are destroyed at the same time.
This is my code in the Enemy class:
override public function update():void{
trace("My obstacle was added");
this.x += speed;
this.y += 0.4;
/*var power : Power = Power(this.collideTypes([Power.power_type], this.x, this.y));
if(power != null){
power.destroy(); */
if ((this.x > FP.screen.width) || (collide("power", this.x, this.y))){ // remove se pegar em alguma coisa
this.world.remove(this);
}
I would like that just one per time was destroyed.
How do I do that?