« 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.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/index.js b/index.js
index 3e46f74..33ea67b 100644
--- a/index.js
+++ b/index.js
@@ -344,6 +344,10 @@ const battleCharacter = new BattleCharacter()
 battleCharacter.x = 0
 battleCharacter.y = 240
 
+const enemyCharacter = new BattleCharacter()
+enemyCharacter.x = 0
+enemyCharacter.y = 200
+
 const atbBar = battleCharacter.atbBar
 //atbBar.queuedActions = [{label: 'Fire', size: 1}, {label: 'Blizz', size: 1}, {label: 'Zap', size: 1}, {label: 'Firaga', size: 3}]
 
@@ -364,6 +368,7 @@ function drawLoop() {
   lastTime = Date.now()
 
   battleCharacter.update(dt)
+  enemyCharacter.update(dt)
   camera.update(dt)
 
   const ctx = canvas.getContext('2d')
@@ -373,7 +378,7 @@ function drawLoop() {
 
   ctx.save()
   ctx.translate(-camera.x, -camera.y)
-  for (const sprite of [backdrop, battleCharacter]) {
+  for (const sprite of [backdrop, enemyCharacter, battleCharacter]) {
     sprite.draw()
     ctx.drawImage(sprite.canvas, sprite.x - sprite.canvas.width / 2, sprite.y - sprite.canvas.height / 2)
   }