After spending ages trying to sort out a healthbar, which I thought was fixed and then this error came up:
java.lang.NullPointerException
at Autodread.enemyCollision(Autodread.java:77)
at Autodread.act(Autodread.java:16)
The source of this error is:
Any tips?
public void enemyCollision() { Actor enemy = getOneIntersectingObject(Enemies.class); if (enemy != null) { getWorld().removeObject(getOneIntersectingObject(Enemies.class)); ScrollWorld world = (ScrollWorld) getWorld(); HealthBar Health = world.getHealth(); Health.setImage(-1); } }