Try to get modifier accell to only apply during modifier range.

This commit is contained in:
Dustin 2025-04-28 19:50:51 -07:00
parent ad01724071
commit 6ea1d12ce4
2 changed files with 11 additions and 3 deletions

View File

@ -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)

View File

@ -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" ]