Skip to content

Commit

Permalink
add slow movement handling (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
GonnaFlyMethod authored Oct 11, 2024
1 parent bc755ca commit 6d28784
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var _mouse_zoom := 0
@export_range(0, 10, 0.01) var sensitivity : float = 3
@export_range(0, 1000, 0.1) var default_velocity : float = 5
@export_range(0, 10, 0.01) var speed_scale : float = 1.17
@export_range(0.1, 0.9) var slow_down_multiplier : float = 0.3
@export_range(1, 100, 0.1) var boost_speed_multiplier : float = 3.0
@export var max_speed : float = 1000
@export var min_speed : float = 0.2
Expand Down Expand Up @@ -110,6 +111,9 @@ func _process(delta: float) -> void:
).normalized()

var step = delta
if Input.is_physical_key_pressed(KEY_ALT): # slow movement
step = delta * slow_down_multiplier

if Input.is_physical_key_pressed(KEY_SHIFT): # boost
step = delta * boost_speed_multiplier

Expand Down

0 comments on commit 6d28784

Please sign in to comment.