This is a code to make it move toward where we click in the background.
OK this is for helping.
thx
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo etc)
public class Object extends Actor
{
public void act()
{
MouseInfo pointer = Greenfoot.getMouseInfo();
if(pointer != null)
{
int mouseX = pointer.getX();
int mouseY = pointer.getY();
turnTowards(mouseX, mouseY);
int button = pointer.getButton();
if(button == 1)
{
move(20);
}
}
}
}