| 134 | } |
| 135 | |
| 136 | public updateHealthBar(): void{ |
| 137 | // We update the health bar if it isn't null |
| 138 | if(this.playerHealthBar != null){ |
| 139 | // We update the bar from the player's health |
| 140 | this.playerHealthBar.update(this.game.getPlayer().getHp() / this.game.getPlayer().getMaxHp(), "Your health : " + this.game.getPlayer().getHp() + "/" + this.game.getPlayer().getMaxHp()); |
| 141 | |
| 142 | // We draw the bar |
| 143 | this.renderArea.drawArea(this.playerHealthBar, 28, 4); |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | // Public getters |
| 148 | public getRenderArea(): RenderArea{ |