diff options
author | Florrie <towerofnix@gmail.com> | 2018-08-12 11:34:55 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-08-12 11:34:55 -0300 |
commit | ab45c4c7da290dcd5071b9e7729538ae3374f80b (patch) | |
tree | b62cd34535c6db9ed43621f4bc49df4fd567b2e5 | |
parent | feb7d1173d4a120edbfb9a348441fd2ebea7b9aa (diff) |
Show HP bars for all party members
-rw-r--r-- | index.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/index.js b/index.js index 02d5d9f..9faed1e 100644 --- a/index.js +++ b/index.js @@ -484,7 +484,7 @@ class Battle { } ctx.restore() - const { atbBar, hpBar } = this.playerCharacter + const { atbBar } = this.playerCharacter let y = canvas.height - 20 if (this.currentMenu) { @@ -498,9 +498,12 @@ class Battle { ctx.drawImage(atbBar.canvas, 20, y) y = canvas.height - 20 - y -= hpBar.canvas.height - hpBar.draw() - ctx.drawImage(hpBar.canvas, canvas.width - 20 - hpBar.canvas.width, y) + for (const { hpBar } of this.playerCharacter.team.characters) { + y -= hpBar.canvas.height + hpBar.draw() + ctx.drawImage(hpBar.canvas, canvas.width - 20 - hpBar.canvas.width, y) + y -= 2 + } if (targetCharacter) { const hpBar = targetCharacter.hpBar |