fix acc
This commit is contained in:
parent
048bb09ab7
commit
8c28a1ab95
1 changed files with 6 additions and 2 deletions
|
@ -18,10 +18,14 @@ func _process(delta: float) -> void:
|
||||||
|
|
||||||
|
|
||||||
if direction != Vector2.ZERO:
|
if direction != Vector2.ZERO:
|
||||||
if direction == previous_direction:
|
if direction.normalized() == previous_direction.normalized():
|
||||||
boost_speed = min(boost_speed + acceleration, max_boost_speed - move_speed)
|
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:
|
else:
|
||||||
boost_speed = 0
|
boost_speed = 0
|
||||||
|
|
||||||
previous_direction = direction
|
previous_direction = direction
|
||||||
velocity = direction * (move_speed + boost_speed)
|
velocity = direction * (move_speed + boost_speed)
|
||||||
print(velocity)
|
print(velocity)
|
||||||
|
|
Loading…
Add table
Reference in a new issue