Hello I am trying to have the player walk up to a character(actor) and a text box or image will appear on top of the screen.
public boolean onGround()
{
int spriteHeight = getImage().getHeight();
int lookForGround = (int)(spriteHeight/2) + 5;
Actor Ground = getOneObjectAtOffset(0, lookForGround, Platform.class);
if(Ground == null)
{
jumping= true;
return false;
}
else
{
moveToGround(Ground);
return true;
}
}
public void moveToGround(Actor Ground)
{
int groundHeight = Ground.getImage().getHeight();
int newY = Ground.getY() - (groundHeight + getImage().getHeight())/2;
setLocation(getX(), newY);
jumping = false;
}