« get me outta code hell

Bluuuuuuuuuuurgh code - 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-23 16:33:13 -0300
committerFlorrie <towerofnix@gmail.com>2018-08-23 16:33:13 -0300
commitbb8ef46f885fafa97b1d3ab8c2bf890dc9748a8e (patch)
tree709c5739bc42ebff6831413078128447d79a7c35
parent82a655308b9b37210e9de8c094a33fdbcf909739 (diff)
Bluuuuuuuuuuurgh code
-rw-r--r--index.js38
1 files 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
     }
+    */
   }
 }