I am making a space invaders game and the alien bullets only hit the space ship if the bullet hits it in the dead center. I want the to make the ship have a better hit detection so the bullets don't pass through the ship.
public void hit()
{
Actor Bullet2;
Bullet2 = isTouching (0, 0, bullet2.class);
if (Bullet2 != null)
{
World world;
world = getWorld();
world.removeObject(Bullet2);
((space)world).healthbar.add(-50);
}
}public void hit()
{
if (isTouching(bullet2.class))
{
removeTouching(bullet2.class);
((space)getWorld()).healthbar.add(-50);
}
}