when a bullet intersects an enemy the enemy is removed but i need the bullet to get removed also need help!!
getWorld().removeObject(this);
getWorld().removeObject(this);
getWorld().removeObject(this);
public void destroyEnemies()
{
//"Enemy" can be any class that you want the bullet to destroy.
Actor enemy = getOneIntersectingObject(Enemy.class);
if(enemy != null)
{
World myWorld = getWorld();
getWorld().removeObject(enemy);
getWorld().removeObject(this);
}
}getWorld().removeObject(this);
destroyEnemies(); if (atWorldEdge()) ...
if (getWorld() != null && atWorldEdge())
destroyEnemies(); if (atWorldEdge()) ...
if (getWorld() != null && atWorldEdge())
public void act()
{
setRotation(direction);
move(19);
if (getWorld() != null) kill();
if (this.atWorldEdge())
{
getWorld().removeObject(this);
}
}destroyEnemies(); if (atWorldEdge()) ...
if (getWorld() != null && atWorldEdge())