in game, my player move up and down but it return to it start position
public class Singh extends Actor
{ public void act()
{
checkKeyPress();
move(2);
}
/**
* Check whether keyboard key press nd react if it has.
*/
public void checkKeyPress ()
{ setLocation(248,237);
if(Greenfoot.isKeyDown("W"))
{
setLocation(getX(),getY()+80);
turn(2);
}
if(Greenfoot.isKeyDown("A"))
{
setLocation(getX(),getY()-80);
}
if(Greenfoot.isKeyDown("S"))
{
setLocation(getX()+80,getY());
}
if(Greenfoot.isKeyDown("D"))
{
setLocation(getX()-80,getY());
}
}
}
