MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / updateHealthBar

Method updateHealthBar

code/main/StatusBar.ts:136–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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{

Callers 1

updateAllMethod · 0.95

Calls 5

getPlayerMethod · 0.80
drawAreaMethod · 0.80
updateMethod · 0.45
getHpMethod · 0.45
getMaxHpMethod · 0.45

Tested by

no test coverage detected