Compare commits

...

3 commits

Author SHA1 Message Date
68602e7f23 finish walk animations 2025-11-23 05:23:56 -03:00
ce52d83958 use typed methods 2025-11-23 03:43:01 -03:00
9f1c42482e change motion mode to floating 2025-11-23 03:36:32 -03:00
3 changed files with 4 additions and 3 deletions

View file

@ -23,12 +23,12 @@ func get_movement_vector() -> Vector2:
var x_strength: float = Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
var y_strength: float = Input.get_action_strength("move_down") - Input.get_action_strength("move_up")
if abs(x_strength) < DEADZONE and abs(y_strength) < DEADZONE:
if absf(x_strength) < DEADZONE and absf(y_strength) < DEADZONE:
return Vector2.ZERO
if abs(x_strength) < DEADZONE:
if absf(x_strength) < DEADZONE:
return Vector2(0, signf(y_strength))
if abs(y_strength) < DEADZONE:
if absf(y_strength) < DEADZONE:
return Vector2(signf(x_strength), 0)
# use most recent axis press

View file

@ -12,6 +12,7 @@ height = 14.0
[node name="Player" type="CharacterBody2D"]
collision_mask = 2
motion_mode = 1
script = ExtResource("1_dovo2")
max_speed = 95.0