fix: move out of wallsliding w/o walljump
This commit is contained in:
parent
746aae7e7f
commit
c323ae6575
@ -340,11 +340,25 @@ func calculate_wallslide_velocity(
|
|||||||
elif is_correct_airstrafe_input():
|
elif is_correct_airstrafe_input():
|
||||||
# var rev = 1 if !is_reversing_horizontal_movement(direction) else -1
|
# var rev = 1 if !is_reversing_horizontal_movement(direction) else -1
|
||||||
linear_velocity = execute_airstrafe(linear_velocity, delta, direction)
|
linear_velocity = execute_airstrafe(linear_velocity, delta, direction)
|
||||||
|
elif (
|
||||||
|
abs(direction.x + wall_touch_direction) < 1
|
||||||
|
&& abs(direction.x + wall_touch_direction) >= 0
|
||||||
|
):
|
||||||
|
var absolut = 1 - initial_velocity_dependence
|
||||||
|
var divisor = 1 / max(0.1, initial_velocity_dependence)
|
||||||
|
var movementFactor = absolut + abs(velocity.x) / (max_velocity["fall"].x * divisor)
|
||||||
|
linear_velocity.x = PhysicsFunc.two_step_euler(
|
||||||
|
linear_velocity.x,
|
||||||
|
acceleration_force["fall"].x * movementFactor * direction.x,
|
||||||
|
mass,
|
||||||
|
delta
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
# TODO dont put constants in here
|
# TODO dont put constants in here
|
||||||
linear_velocity.y = PhysicsFunc.two_step_euler(
|
linear_velocity.y = PhysicsFunc.two_step_euler(
|
||||||
linear_velocity.y * 0.94, _gravity * mass, mass, delta
|
linear_velocity.y * 0.94, _gravity * mass, mass, delta
|
||||||
)
|
)
|
||||||
|
# TODO single out to function
|
||||||
air_strafe_charges = (
|
air_strafe_charges = (
|
||||||
air_strafe_charges + 1
|
air_strafe_charges + 1
|
||||||
if max_air_strafe_charges > air_strafe_charges
|
if max_air_strafe_charges > air_strafe_charges
|
||||||
|
|||||||
@ -255,6 +255,8 @@ follow_focus = true
|
|||||||
|
|
||||||
[node name="ActionKeyList" type="VBoxContainer" parent="Panel/KeymapViewer/ScrollContainer"]
|
[node name="ActionKeyList" type="VBoxContainer" parent="Panel/KeymapViewer/ScrollContainer"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
margin_right = 600.0
|
||||||
|
margin_bottom = 189.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
script = ExtResource( 14 )
|
script = ExtResource( 14 )
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user