Hi,
I am currently trying to get the distance between my main actor and another class.
So I'm like standing on a random position in the world and somewhere is a obstacle.
So I coded
So when I'm in horizontal range of the obstacle and I press the "up" key I want to move forward to the exact position of the obstacle ( the obstacle is at a random position).
Is there a way to get the distance?
Actor obstacle = getOneObjectAtOffset(200, 0, obstacle.class);
if (obstacle != null && Greenfoot.isKeyDown("up")){
setLocation(getX() "??", getY());
}

