Compare commits
3 commits
47aa35a4c7
...
68602e7f23
| Author | SHA1 | Date | |
|---|---|---|---|
| 68602e7f23 | |||
| ce52d83958 | |||
| 9f1c42482e |
3 changed files with 4 additions and 3 deletions
Binary file not shown.
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue