Whenever this person touches the ground or the top he stops... what is wrong with my code?
public int ySpeed;
public void act()
{
if(getY() > 10 && getY() < 363) setLocation(getX(), getY() + ySpeed);
if(Greenfoot.isKeyDown("space") && getY() > 10)
{
ySpeed --;
}
else if(getY() < 363)
{
ySpeed ++;
}
else
{
setLocation(getX(), getY());
}
}


