use typed methods
This commit is contained in:
parent
9f1c42482e
commit
ce52d83958
1 changed files with 3 additions and 3 deletions
|
|
@ -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 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")
|
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
|
return Vector2.ZERO
|
||||||
|
|
||||||
if abs(x_strength) < DEADZONE:
|
if absf(x_strength) < DEADZONE:
|
||||||
return Vector2(0, signf(y_strength))
|
return Vector2(0, signf(y_strength))
|
||||||
if abs(y_strength) < DEADZONE:
|
if absf(y_strength) < DEADZONE:
|
||||||
return Vector2(signf(x_strength), 0)
|
return Vector2(signf(x_strength), 0)
|
||||||
|
|
||||||
# use most recent axis press
|
# use most recent axis press
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue