I have two entities. Bullet and Enemy
Bullet Entity:
BULLET OVERRIDE
if (collide("enemy", x, y) && collidable)
{
hit.play();
graphic = hitfx;
hitfx.play("stand");
firespeed = 0;
FP.world.bringToFront(this);
collidable = false;
}
if (hitfx.complete && firespeed == 0) { FP.world.remove(this); }
Enemy Entity:
ENEMY OVERRIDE
if (collide("bullet", x, y))
{
armor -= FP.world.getInstance("playerx").bulletdamage;
graphicfx.tinting = 0.5;
fxtimer = 2;
if (armor <= 0) { FP.world.remove(this); }
}
fxtimer --;
if (fxtimer == 0) { graphicfx.tinting = 0; }
RESULT: Everything works fine in BULLET OVERRIDE. But, ENEMY is not detecting collision in ENEMY OVERRIDE. My think, Enemy should detect collision for one time because before collision the Bullet’s “collidable=true”;
Also both overrides have super.update(); at first lines. Actually i don’t know what is it…
And main settings: super(500, 500, 60, true);
All about timing. But how. When i remove “collidable=false” function from Bullet, enemy detecting collision. But why it is not detecting in same time with Bullet’s enemy detection.