« 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.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/index.js b/index.js
index 2762bf6..c7327d6 100644
--- a/index.js
+++ b/index.js
@@ -613,7 +613,8 @@ class BattleCharacter extends Sprite {
   determineNewTarget(targetType) {
     const targets = this.getValidTargets(targetType)
     if (targets.length) {
-      this.targetCharacter = targets[0]
+      // TODO: Some sort of "follow the leader" mechanic
+      this.targetCharacter = targets[Math.floor(Math.random() * targets.length)]
     } else {
       this.targetCharacter = null
     }