Hello,
i have some problem here,
so the code work but some key are unable to activate when "x" key is pressed .-.
is theres something wrong with my code?
Thx :)
public void heroMovement()
{
int x = getX();
int y = getY();
if(Greenfoot.isKeyDown("Up"))
{
setLocation(x,y-5);
}
if(Greenfoot.isKeyDown("Down"))
{
setLocation(x,y+5);
}
if(Greenfoot.isKeyDown("Left"))
{
setLocation(x-5,y);
}
if(Greenfoot.isKeyDown("Right"))
{
setLocation(x+5,y);
}
}