I can't figure out how to prevent the player to jump through the ground from underneath by just jumping. I want the player to be forced to find holes in the ground to be able to access the next floor.
I tried to use this but visibly it doesn't work:
Thanks for the help
public void act()
{
//other codes
moveAround();
}
public void moveAround()
{
//other moving codes
if(underGround()){ setLocation(getX(), getY() - 10);}
}
boolean underGround()
{
Actor under = getOneObjectAtOffset(getX(), getY() - getImage().getHeight()/2, Ground.class);
return under != null;
}
