barbarian anim

This commit is contained in:
Martin
2022-12-31 12:53:49 +01:00
parent e03274d3cb
commit 50c44b7d64
13 changed files with 107 additions and 231 deletions

View File

@@ -26,12 +26,13 @@ export class PeriodicFollowTargetEnemyMover extends EnemyMover {
this.switchEnemyFollowState(enemy);
} else {
this.enemyToStateTimeLeft.set(enemy, stateTimeLeft);
if (this.enemyToFollowState.get(enemy) === EnemyFollowState.Follow) {
let direction: Vec3 = new Vec3();
direction = Vec3.subtract(direction, this.targetNode.worldPosition, enemy.node.worldPosition);
enemy.gameTick(direction.normalize(), deltaTime);
}
}
if (this.enemyToFollowState.get(enemy) === EnemyFollowState.Follow) {
let direction: Vec3 = new Vec3();
direction = Vec3.subtract(direction, this.targetNode.worldPosition, enemy.node.worldPosition);
enemy.gameTick(direction.normalize(), deltaTime);
} else if (this.enemyToFollowState.get(enemy) === EnemyFollowState.Wait) {
enemy.gameTick(new Vec3(), deltaTime);
}
}
}