feat: wallhang for blobby

This commit is contained in:
Jakob Feldmann 2023-11-08 16:21:15 +01:00
parent 2d9a4337be
commit e4aa8d0470
2 changed files with 13 additions and 3 deletions

View File

@ -18,6 +18,9 @@ var wallslide_threshold := 1000
var base_floor_friction := 0.5
var initial_velocity_dependence := 0.7
var floor_friction := base_floor_friction
var wall_friction := 0.94
var wall_hang_time := 0.162
var wall_hang_friction := 0.33
# TODO Mixing Vectors and ints is questionable
var max_velocity := {
"walk": 120,

View File

@ -362,6 +362,7 @@ func calculate_wallslide_velocity(
elif is_correct_airstrafe_input():
# var rev = 1 if !is_reversing_horizontal_movement(direction) else -1
linear_velocity = execute_airstrafe(linear_velocity, delta, direction)
# Moving out of wallslide
elif (
abs(direction.x + wall_touch_direction) < 1
&& abs(direction.x + wall_touch_direction) >= 0
@ -375,11 +376,17 @@ func calculate_wallslide_velocity(
mass,
delta
)
else:
# Slowed fall/slide on wall
elif wall_hang_time <= player_state_machine.state_time:
# TODO dont put constants in here
linear_velocity.y = PhysicsFunc.two_step_euler(
linear_velocity.y * 0.94, _gravity * mass, mass, delta
linear_velocity.y * wall_friction, _gravity * mass, mass, delta
)
else:
linear_velocity.y = PhysicsFunc.two_step_euler(
linear_velocity.y * wall_hang_friction, _gravity * mass, mass, delta
)
# TODO single out to function
air_strafe_charges = (
air_strafe_charges + 1
@ -458,7 +465,7 @@ func stomp() -> void:
stomping = true
# TOD lose_power_up function
# TODO lose_power_up function
func receive_power_up(kind: String) -> void:
if kind == "shield":
$BubbleShieldViewport/IridescenceBall.visible = true