Closed Col-E closed 7 years ago
Found the issue source:
Creature.renderHealthBar()
if (hp < 0.3f) {
Graphics.batch.setColor(1, 0, 0, 1);
} else if (hp < 0.6f) {
Graphics.batch.setColor(1, 1, 0, 1);
} else {
Graphics.batch.setColor(0, 1, 0, 1);
}
This seems to be applying to the player and not the slimes from the pic.
Fixed by the following:
@Override
public void render() {
// Reset color in case last entity was damaged.
Graphics.batch.setColor(1, 1, 1, 1);
// super.render(); // old placement
if (this.stats.getHp() != this.stats.getMaxHP() && this.stats.getHp() != 0) {
this.renderHealthBar();
}
// new placement
super.render();
}
Closed in pull https://github.com/egordorichev/LastTry/pull/71
Attacking slimes causes the player (and sometimes other GUI textures such as the hearts) to be random colors. Seems like the only colors as of right now are: Green, Yellow, Red.