Hello everyone, I need help because my actor can get on the platform and move with it, but it will be great if he could only go on the platform by the top and not by the bottom and both sides because he stick to it
I've tried something like this but it tells me that I can't use a static thing in a non-static method:
and there's the complete code at the moment :
Thanks !
public void checkXY()
{ if(Pony.getY<Plateform.getY())
{
fall();
}
}public void fall()
{
setLocation (getX(), getY() + vSpeed);
vSpeed = vSpeed + acceleration;
}
public boolean onGroud ()
{
int spriteHeight = getImage().getHeight();
int lookForGround = (int) (spriteHeight/2);
Actor ground = getOneObjectAtOffset (0, lookForGround, Platform.class);
if (ground == null)
{
return false;
}
else
{
return true;
}
}
public void checkFall ()
{
if (onGround())
{
vSpeed = 0;
}
else
{
fall();
}
}
private void jump()
{
vSpeed = -jumpStrength;
fall();
}
