hi, I have a problem, I want an actor to detect when there is a certain other actor in the world and then automatically move to it. Is that possible somehow?
1 | java.util.List actors = getWorld().getObjects(Actor.class); |
1 2 3 4 5 6 7 | if (! actors.isEmpty()){ Actor actor = (Actor)actors.get(0); turnTowards(actor.getX(), actor.getY()); move(3); // setRotation(0); // to maintain upright actor} |