Anyone no how to remove the shot/ammo when it touches something else or the edge of the world
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(20.0);
life--;
eat();
if (life == 0)
{
getWorld().removeObject(this);
}
}
public void eat()
{
Actor Miniship;
Miniship = getOneObjectAtOffset(0, 0, Miniship.class);
if (Miniship != null)
{
World world;
world = getWorld();
world.removeObject(Miniship);
}
Actor Warship;
Warship = getOneObjectAtOffset(0, 0, Warship.class);
if (Warship != null)
{
World world;
world = getWorld();
world.removeObject(Warship);
}
}
}