From bb8ef46f885fafa97b1d3ab8c2bf890dc9748a8e Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 23 Aug 2018 16:33:13 -0300 Subject: Bluuuuuuuuuuurgh code --- index.js | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/index.js b/index.js index e779ff8..da94468 100644 --- a/index.js +++ b/index.js @@ -876,7 +876,6 @@ class Battle { this.backdrop = new Backdrop() this.camera = new BattleCamera(this) - // this.camera.follow(this.playerCharacter) this.slideacrossMessage = new SlideacrossMessage() @@ -1158,7 +1157,6 @@ class Battle { changeLeader(newCharacter) { if (newCharacter) { this.playerCharacter = newCharacter - // this.camera.follow(newCharacter) newCharacter.atbBar.queuedActions.splice(0) newCharacter.isExecutingChain = false this.showTargetTypeMenu() @@ -1252,40 +1250,12 @@ class Camera extends Sprite { constructor() { super() - this.spriteToFollow = null this.width = 200 this.height = 200 this.focalLength = 300 } - update(dt) { - if (this.spriteToFollow) { - const target = this.getCenteredCoords(this.getSpriteFollowCoords(this.spriteToFollow)) - this.x += 5 * dt * (target.x - this.x) - this.y += 5 * dt * (target.y - this.y) - } - } - - follow(sprite) { - this.spriteToFollow = sprite - } - - warpTo(sprite) { - const target = this.getCenteredCoords(this.getSpriteFollowCoords(sprite)) - this.x = target.x - this.y = target.y - } - - getSpriteFollowCoords(sprite) { - return {x: sprite.x, y: sprite.y} - } - - getCenteredCoords(sprite) { - return { - x: sprite.x - this.width / 2, - y: sprite.y - this.height / 2 - } - } + update(dt) {} getScaleRatio(z) { return this.focalLength / (this.focalLength + z) @@ -1299,8 +1269,9 @@ class BattleCamera extends Camera { this.battle = battle } - getSpriteFollowCoords(sprite) { - // TODO: Decide exactly how the sprite should be taken into account.. right now it's not at all. + update(dt) { + /* + // TODO: Decide exactly how battle characters should be taken into account.. right now they're not at all. const bx = this.battle.battlefieldCenterX const by = this.battle.battlefieldCenterY // return {x: bx + (sprite.x - bx) / 3, y: by + (sprite.y - by) / 3} @@ -1319,6 +1290,7 @@ class BattleCamera extends Camera { x: (leftmostX + rightmostX) / 2, y: (topmostY + bottommostY) / 2 } + */ } } -- cgit 1.3.0-6-gf8a5