Try to get modifier accell to only apply during modifier range.
This commit is contained in:
parent
ad01724071
commit
6ea1d12ce4
|
|
@ -357,11 +357,19 @@ func resolve_h_acceleration(_params :Dictionary, _inertia :Vector2, _move_direct
|
||||||
## TODO: Adjust for jerk, determine if we're currently experiencing accel
|
## TODO: Adjust for jerk, determine if we're currently experiencing accel
|
||||||
## if a speed difference applies
|
## if a speed difference applies
|
||||||
var _acceleration :float = 0.0
|
var _acceleration :float = 0.0
|
||||||
|
var base_speed :float = _params["_base_h_move_speed"]
|
||||||
if _params["_base_h_move_speed_modifier"] != 0:
|
if _params["_base_h_move_speed_modifier"] != 0:
|
||||||
_acceleration = _params["_base_h_move_acceleration"] + _params["_base_h_move_modifier_move_acceleration"]
|
var speed_differance = base_speed + _params["_base_h_move_speed_modifier"]
|
||||||
|
_acceleration = _params["_base_h_move_acceleration"] #+ _params["_base_h_move_modifier_move_acceleration"]
|
||||||
|
##WIP: Add part where offset acceleration only applies until the inertia equals the offset or whatever
|
||||||
|
if sign(_params["_base_h_move_modifier_move_acceleration"]) == -1 and abs(_inertia.x) >= speed_differance:
|
||||||
|
#print("I should add the modifier acceleration maybe?")
|
||||||
|
_acceleration += _params["_base_h_move_modifier_move_acceleration"]
|
||||||
|
else:
|
||||||
|
print ("not yet.")
|
||||||
else:
|
else:
|
||||||
_acceleration = _params["_base_h_move_acceleration"]
|
_acceleration = _params["_base_h_move_acceleration"]
|
||||||
##TODO: Add part where offset acceleration only applies until the inertia equals the offset or whatever
|
|
||||||
|
|
||||||
|
|
||||||
#_acceleration *= sign(_move_direction)
|
#_acceleration *= sign(_move_direction)
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@ name = "roll"
|
||||||
horizontal_speed = 150.0
|
horizontal_speed = 150.0
|
||||||
horizontal_acceleration = 1.36422e-12
|
horizontal_acceleration = 1.36422e-12
|
||||||
horizontal_speed_offset = -140.0
|
horizontal_speed_offset = -140.0
|
||||||
horizontal_speed_offset_acceleration = -50.0
|
horizontal_speed_offset_acceleration = -300.0
|
||||||
jerk_factor = 0.0
|
jerk_factor = 0.0
|
||||||
animation_sequence = [ "roll" ]
|
animation_sequence = [ "roll" ]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user