diff options
author | Florrie <towerofnix@gmail.com> | 2018-08-19 15:30:21 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-08-19 15:30:21 -0300 |
commit | f8a1ea210f120bb0f7e9ddd8895aa1391650ee71 (patch) | |
tree | e57987b3701a551386cb455778b66aa28a86b6b0 | |
parent | 03633d5db719211e487991d66f76484cd8cd4d7c (diff) |
Fix order of HP bar rendering
-rw-r--r-- | index.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/index.js b/index.js index 1b7c633..5138e92 100644 --- a/index.js +++ b/index.js @@ -994,7 +994,9 @@ class Battle { ctx.drawImage(atbBar.canvas, 20, y - atbBar.canvas.height) y = canvas.height - 20 - for (const { hpBar } of this.playerCharacter.team.characters) { + const hpBars = this.playerCharacter.team.characters.map(c => c.hpBar) + hpBars.reverse() // To match the order in the target menu + for (const hpBar of hpBars) { y -= hpBar.canvas.height hpBar.draw() const x = canvas.width - 20 - hpBar.canvas.width |