enhancement: halve velocity when bouncing

This commit is contained in:
2025-10-21 11:31:40 -06:00
parent f10c4aab1c
commit bac0be6e2e

View File

@@ -65,7 +65,7 @@ func _process(delta: float) -> void:
if global_position.x >= max_x && velocity > 0: if global_position.x >= max_x && velocity > 0:
if bounce: if bounce:
velocity = -(velocity) velocity = -(velocity)/2
print("velocity negated, bouncing") print("velocity negated, bouncing")
global_position.x = 999 global_position.x = 999
time_since_first_location = -1 time_since_first_location = -1
@@ -74,7 +74,7 @@ func _process(delta: float) -> void:
elif global_position.x < min_x && velocity < 0: elif global_position.x < min_x && velocity < 0:
if bounce: if bounce:
velocity = -(velocity) velocity = -(velocity)/2
print("velocity negated, bouncing") print("velocity negated, bouncing")
global_position.x = 1 global_position.x = 1
time_since_first_location = -1 time_since_first_location = -1