« 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.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/index.js b/index.js
index a39f314..e312d32 100644
--- a/index.js
+++ b/index.js
@@ -522,6 +522,8 @@ class Team {
   constructor({battle}) {
     this.battle = battle
     this.characters = [
+      new BattleCharacter({team: this, battle}),
+      new BattleCharacter({team: this, battle}),
       new BattleCharacter({team: this, battle})
     ]
   }
@@ -556,10 +558,23 @@ class Camera extends Sprite {
 
 const battle = new Battle()
 
-Object.assign(battle.teams[0].characters[0], {x: 0, y: 240, name: 'Ren'})
-Object.assign(battle.teams[1].characters[0], {x: 0, y: 200, name: 'Phooey'})
-
-// battleCharacter.targetCharacter = enemyCharacter
+for (let ti = 0; ti < battle.teams.length; ti++) {
+  const team = battle.teams[ti]
+  for (let ci = 0; ci < team.characters.length; ci++) {
+    Object.assign(team.characters[ci], [
+      [
+        {x: 0, y: 240, name: 'Ren'},
+        {x: -40, y: 240, name: 'Fie'},
+        {x: 40, y: 240, name: 'Grat'}
+      ],
+      [
+        {x: -40, y: 200, name: 'Nomber A'},
+        {x: 0, y: 200, name: 'Nomber B'},
+        {x: 40, y: 200, name: 'Flaprat'}
+      ]
+    ][ti][ci])
+  }
+}
 
 const camera = battle.camera
 camera.width = canvas.width