I want that when an actor touches an moving actor, it also moves with the moving actor. How to do it?
// in class of followed actor
// instance field
private Actor follower;
// in act (or in a method it calls)
if (follower == null) follower = getOneIntersectingObject(FollowerClassName.class);
// when moving actor (using setLocation(getX()+dx, getY()+dy); where dx and dy are the changes in location
if (follower != null)
{
if (follower.getWorld() == null) follower = null; else follower.setLocation(follower.getX()+dx, follower.getY()+dy);
}