When is the one actor needing to know the position of the other? Is there any interaction between the two actors that triggers the need to know? Basically, why does the actor need this information (or for what purpose is the information needed)?
I am making a paddle-ball game....I want that in the beginning (when ball is not launched) the ball moves along with the paddle when the paddle is moved...
The ball will have two states -- an unlaunched state and a launched state. In the one (unlaunched) it will move with the paddle; and in the other it will move around on its own. You will need a Boolean field to track the unlaunched/launched state of the ball. When it is not launched, the paddle should be directly below it; so, you can use 'int paddleX = getOneObjectsAtOffset(0, getImage().getHeight()/2+5, Paddle.class).getX();' to get the x-coordinate of the paddle and then move the ball using 'setLocation(paddleX, getY());' to keep it with the paddle. If the ball is launched, then it should move normally.