and underneath my public void act, these are my codes
public void addedToWorld (World w)
{
active = true;
}
private void checkKeys()
{
if (active == true)
{
if (Greenfoot.isKeyDown("up"))
{
setLocation (getX(), getY() - movement);
}
if (Greenfoot.isKeyDown("down"))
{
setLocation (getX(), getY() + movement);
}
else if (Greenfoot.isKeyDown("left"))
{
setLocation (getX() - movement, getY());
}
else if (Greenfoot.isKeyDown("right"))
{
setLocation (getX() + movement, getY());
}
}
}

