mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-09-24 04:39:05 +00:00
barbarian anim
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user