diff --git a/src/empty_space_thing.gd b/src/empty_space_thing.gd index c303217..e4d96ed 100644 --- a/src/empty_space_thing.gd +++ b/src/empty_space_thing.gd @@ -28,7 +28,7 @@ func _process(delta: float) -> void: time_since_first_location = 0 if Input.is_action_pressed("click"): - time_since_first_location += delta + mouse_first_location = get_global_mouse_position() elif Input.is_action_just_released("click"): time_since_first_location += delta @@ -36,14 +36,14 @@ func _process(delta: float) -> void: if mouse_release_location.x < mouse_first_location.x: var distance = mouse_release_location.x - mouse_first_location.x velocity = (distance / - (velocity_coeffecient * time_since_first_location)) + (velocity_coeffecient * delta)) draggable = false elif mouse_release_location.x > mouse_first_location.x: var distance = abs(mouse_first_location.x - mouse_release_location.x) velocity = (distance / - (velocity_coeffecient * time_since_first_location)) + (velocity_coeffecient * delta)) draggable = false elif not draggable: diff --git a/src/scroll_root.tscn b/src/scroll_root.tscn index e4f643c..1143f22 100644 --- a/src/scroll_root.tscn +++ b/src/scroll_root.tscn @@ -23,4 +23,4 @@ offset_top = 299.0 offset_right = 455.0 offset_bottom = 299.0 script = ExtResource("2_mej84") -velocity_coeffecient = 735 +velocity_coeffecient = 220