Hi, I have a problem. How can I move any Actor1 (no matter if .get(0) or .get(1) and so on) if it is on the moving Actor2?
How can I move the Object, that is on Actor2 and not the first one in the list(so something else instead of .get(0))
//actor1IsUp() is a method, that proves if Actor1 is up
//this Actor(Actor2) moves automatically and it's direction changes automatically
if(actor1IsUp() & direction == "left")
{
Actor actor1 = getWorld().getObjects(Actor1.class).get(0);
actor1.setLocation(actor1.getX() - 1, actor1.getY());
}
else if(actor1IsUp() & direction == "right")
{
Actor actor1 = getWorld().getObjects(Actor1.class).get(0);
actor1.setLocation(actor1.getX() + 1, actor1.getY());
}
