« get me outta code hell

Add dummy enemy character - csb-game - Pixelly spin-off of the Command Synergy Battle system used in Final Fantasy XIII
summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-08-12 09:47:31 -0300
committerFlorrie <towerofnix@gmail.com>2018-08-12 09:47:31 -0300
commit5632d6eb9f15a74f83bda68a0cf319d9c4d03634 (patch)
tree2b8711fc412e9d6bf217fe73b83de381bf2a57f6
parentce8823196034323f1613d87b52155543a9247f47 (diff)
Add dummy enemy character
-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)
   }