replaced files

This commit is contained in:
Vasyl Kazakov
2026-06-18 16:47:23 +03:00
parent 7cc63dbba9
commit ce3f254bc1
49 changed files with 141 additions and 181 deletions
@@ -0,0 +1,28 @@
import { BaseAnimation } from "../../../Enums/BaseAnimation";
import { IPlayerState } from "../IPlayerState";
import { PlayerContext } from "../PlayerContext";
import { PlayerStateType } from "../PlayerStateType";
export class IdleState implements IPlayerState {
enter(context: PlayerContext): void {
if (context.skipStateEnterAnimation) {
context.skipStateEnterAnimation = false;
return;
}
context.character.playAnimation(BaseAnimation.Idle);
}
exit(_context: PlayerContext): void {}
update(context: PlayerContext, _deltaTime: number): void {
if (context.isMoving()) {
context.stateMachine.setState(PlayerStateType.Run);
return;
}
const body = context.physics.getPhysicsBody();
body.velocity.set(0, 0, 0);
body.wakeUp();
}
}