Closest roll yet. Still missing something.

This commit is contained in:
Dustin 2025-04-27 09:48:48 -07:00
parent 5ecbbccf7e
commit 46a3dc704a

View File

@ -213,7 +213,12 @@ func new_move_actor_as_desired(_delta :float,
if calc_inertia.x == 0.0: if calc_inertia.x == 0.0:
calc_inertia.x = h_speed.x calc_inertia.x = h_speed.x
## Apply acceleration ## Apply acceleration
if h_speed.y > h_speed.x:
calc_inertia.x = move_toward(calc_inertia.x, h_speed.y, (calc_acceleration.x * _delta)) calc_inertia.x = move_toward(calc_inertia.x, h_speed.y, (calc_acceleration.x * _delta))
else:
## use of move_toward forcing need to apply negative accel as postitive.
calc_inertia.x = move_toward(calc_inertia.x, h_speed.y, abs(calc_acceleration.x * _delta))
## Apply friction ## Apply friction
calc_inertia.x = move_toward(calc_inertia.x, 0, (calc_friction.x * _delta)) calc_inertia.x = move_toward(calc_inertia.x, 0, (calc_friction.x * _delta))
# calc_inertia.x = clamp( calc_inertia.x + (calc_friction.x * _delta), # calc_inertia.x = clamp( calc_inertia.x + (calc_friction.x * _delta),