I’m using this code to movement & check collision in Bullet entity but a few bullets in a several going through without hitting enemy… :?
override public function update():void
{
x += Math.cos(targetangle * FP.RAD) * firespeed * FP.elapsed;
y += Math.sin(targetangle * FP.RAD) * firespeed * FP.elapsed;
firespeed = firespeed * 0.99;
if (collide("enemy", x, y))
{
hit.play();
var hitanim:Entity = world.add(new HitAnim());
hitanim.x = x;
hitanim.y = y;
world.remove(this);
}
if (! onCamera) { world.remove(this); }
}