This commit is contained in:
2026-03-13 22:00:02 -05:00
parent 90241d6830
commit 6738e8d217
676 changed files with 15819 additions and 78 deletions

View File

@@ -0,0 +1,22 @@
extends BaseState
@export var walking_speed := 100
@export var movement_component: MovementComponent
@export var direction_component: FacingDirectionComponent
@export var body: CharacterBody2D
func GetStateEnum() -> PlayerStateMachine.States:
return PlayerStateMachine.States.WALKING
func Update(_delta: float) -> void:
if movement_component.movement_vector == Vector2.ZERO:
state_machine.QueueStateChange(PlayerStateMachine.States.IDLE)
return
var movement_vector := movement_component.movement_vector
body.velocity = movement_vector * walking_speed
body.move_and_slide()
direction_component.ChangeDirectionUsingMovementVector(movement_vector)