From 5632d6eb9f15a74f83bda68a0cf319d9c4d03634 Mon Sep 17 00:00:00 2001 From: Florrie Date: Sun, 12 Aug 2018 09:47:31 -0300 Subject: Add dummy enemy character --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'index.js') 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) } -- cgit 1.3.0-6-gf8a5