Here is the code for my health. It is not working, how do fix?
Bullet Class
Main/Player Class
Ples Help
public void hitPlayer() {
Actor main = (Main) getOneObjectAtOffset(0, 0, Main.class);
if (main != null) {
main.health--;
if(main.getHealth() == 0){
//KillPlayer
}
getWorld().removeObject(this);
isInWorld = false;
}
} private int health = 2;
public int getHealth(){
return health;
}

