Closest roll yet. Still missing something.
This commit is contained in:
parent
5ecbbccf7e
commit
46a3dc704a
|
|
@ -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
|
||||||
calc_inertia.x = move_toward(calc_inertia.x, h_speed.y, (calc_acceleration.x * _delta))
|
if h_speed.y > h_speed.x:
|
||||||
|
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),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user