diff --git a/src/shattered_sword/AI/EnemyAI.ts b/src/shattered_sword/AI/EnemyAI.ts index 02b277b..c29ad70 100644 --- a/src/shattered_sword/AI/EnemyAI.ts +++ b/src/shattered_sword/AI/EnemyAI.ts @@ -183,8 +183,10 @@ export default class EnemyAI extends StateMachineGoapAI implements BattlerAI { update(deltaT: number){ if (InputWrapper.getState() != GameState.GAMING) { + this.owner.animation.pause(); return; } + this.owner.animation.resume(); super.update(deltaT); // This is the plan that is executed in the Active state, so whenever we don't have a plan, acquire a new one given the current statuses the enemy has diff --git a/src/shattered_sword/Tools/InputWrapper.ts b/src/shattered_sword/Tools/InputWrapper.ts index 23a3023..8112667 100644 --- a/src/shattered_sword/Tools/InputWrapper.ts +++ b/src/shattered_sword/Tools/InputWrapper.ts @@ -148,6 +148,7 @@ export default class InputWrapper { Input.enableInput(); } + // DO NOT call this function directly static setState(gameState: GameState): void { InputWrapper.gameState = gameState; }