I can't get the position of my "Shooter" from my "asteroid" that i am having turn towards "Shooter"
if (getWorld() != null)
{
if ( ! getWorld().getObjects(Shooter.class).isEmpty())
{
Actor shooter = getWorld().getObjects(Shooter.class).get(0);
turnTowards(shooter.getX(), shooter.getY());
}
}public World w = getWorld();
public boolean start = true;
public void act()
{
move(1);
if(isAtEdge())
{
//w.removeObject(this);
}
if(start)
{
spawn();
start = false;
}
}
public void spawn()
{
if(getWorld() != null)
{
if(!getWorld().getObjects(Shooter.class.isEmpty()))
{
Actor shooter = getWorld().getObjects(Shooter.class).get(0);
turnTowards(w.getWidth()/2, w.getHeight()/2);
}
}
}if(!getWorld().getObjects(Shooter.class).isEmpty())
if(!getWorld().getObjects(Shooter.class.isEmpty()))
if(!getWorld().getObjects(Shooter.class).isEmpty())
if(!getWorld().getObjects(Shooter.class.isEmpty()))