Hello I got a problem. When I let my Player climb a ladder it works fine, but sometimes he glitches like for example falling out of the world or fall surprisingly fast, when I go off the ladder...
Player class:
{
private int vSpeed = 0;
public void act
{
if(isTouching(Ladder_Long_Function.class) == false)
fall();
if(isTouching(Ladder_Long_Function.class) && Greenfoot.isKeyDown("up"))
{
setImage(myGif3.getCurrentImage());
setLocation(getX(), getY()-5);
}
}
public void fall()
{
setLocation(getX(), getY() + vSpeed);
}
}