player character has move and dodge

This commit is contained in:
2025-06-23 22:58:24 -05:00
parent 4d27d00b73
commit a2df5e276a
18 changed files with 292 additions and 48 deletions

View File

@@ -0,0 +1,19 @@
extends PlayerState
class_name PlayerOnFloor
func Physics_Update(delta):
dodge_roll()
standard_movement(delta)
body_look_at_mouse()
apply_gravity(delta)
respawn_on_fall(delta)
func dodge_roll():
if character.is_on_floor():
if character.stamina > character.DODGE_STAMINA_COST:
if Input.is_action_just_pressed("dodge"):
var dodge_direction = Input.get_vector("move_left", "move_right", "move_forward", "move_backward")
if dodge_direction:
character.stamina -= character.DODGE_STAMINA_COST
character.dodge_direction = dodge_direction
Transitioned.emit(self,"dodge roll")