This commit is contained in:
Elouan 2025-01-24 12:25:22 +01:00
parent 048bb09ab7
commit 8c28a1ab95

View file

@ -18,10 +18,14 @@ func _process(delta: float) -> void:
if direction != Vector2.ZERO:
if direction == previous_direction:
boost_speed = min(boost_speed + acceleration, max_boost_speed - move_speed)
if direction.normalized() == previous_direction.normalized():
if direction.x != 0 and direction.y != 0:
boost_speed = min(boost_speed + acceleration / 8, (max_boost_speed - move_speed) / 8)
else:
boost_speed = min(boost_speed + acceleration, max_boost_speed - move_speed)
else:
boost_speed = 0
previous_direction = direction
velocity = direction * (move_speed + boost_speed)
print(velocity)