Anyone know how to fix this?
private BossHealth bossHealth;
if (getWorld() != null)
{
bossHealth.setLocation(getX(), getY());
}private BossHealth bossHealth;
int lives = 50;
public void act()
{
Main main = (Main)getWorld();
die();
if (getWorld() != null)
{
bossHealth.setLocation(getX(), getY());
}
} public void act()
{
if (getWorld() != null)
{
int x=getX();
int y=getY()-90;
Actor health = (Actor)getWorld().getObjects(BossHealth.class).get(0);
health.setLocation(x,y);
}
}