Hi,
I am making a platformer game. My character stands in the middle of the platform instead of the top. It is a bit inconsistent. Pictures: , .
Here is my code. In the onGround boolean, the y-value has to be half my character's height. I cant get getHeight()/2 to work.
PS: all images are fit to canvas (no extra blank space).
-Thanks
public void fall()
{
setLocation ( getX() , getY() + vSpeed );
vSpeed = vSpeed + accel;
}
public boolean onGround()
{
Actor under = getOneObjectAtOffset (0, 30 , Ground.class);
return under != null;
}
public void checkFall()
{
if (onGround())
{
vSpeed = 0;
}
else
{
fall();
}
}


