« get me outta code hell

csb-game - Pixelly spin-off of the Command Synergy Battle system used in Final Fantasy XIII
summary refs log tree commit diff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js11
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