Basically, I got a code from one class where it would call another class method
public void healthDecrease() {
if (isTouching(Enemy.class)) {
removeTouching(Enemy.class);
healthDown.healthLess();
}
}
^^^ this is the code for one class named Player
public void healthLess() {
setImage(health);
healthNum++;
if (healthNum == 6) {
healthNum = 0;
}
}
^^^ this is the code for the HealthBar
The problem is that somehow the healthDown.healthLess(); doesn't transfer to the method healthLess(). Anyone knows the problem?