feat: wallhang for blobby
This commit is contained in:
parent
2d9a4337be
commit
e4aa8d0470
@ -18,6 +18,9 @@ var wallslide_threshold := 1000
|
|||||||
var base_floor_friction := 0.5
|
var base_floor_friction := 0.5
|
||||||
var initial_velocity_dependence := 0.7
|
var initial_velocity_dependence := 0.7
|
||||||
var floor_friction := base_floor_friction
|
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
|
# TODO Mixing Vectors and ints is questionable
|
||||||
var max_velocity := {
|
var max_velocity := {
|
||||||
"walk": 120,
|
"walk": 120,
|
||||||
|
|||||||
@ -362,6 +362,7 @@ 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)
|
||||||
|
# Moving out of wallslide
|
||||||
elif (
|
elif (
|
||||||
abs(direction.x + wall_touch_direction) < 1
|
abs(direction.x + wall_touch_direction) < 1
|
||||||
&& abs(direction.x + wall_touch_direction) >= 0
|
&& abs(direction.x + wall_touch_direction) >= 0
|
||||||
@ -375,11 +376,17 @@ func calculate_wallslide_velocity(
|
|||||||
mass,
|
mass,
|
||||||
delta
|
delta
|
||||||
)
|
)
|
||||||
else:
|
# Slowed fall/slide on wall
|
||||||
|
elif wall_hang_time <= player_state_machine.state_time:
|
||||||
# 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 * 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
|
# TODO single out to function
|
||||||
air_strafe_charges = (
|
air_strafe_charges = (
|
||||||
air_strafe_charges + 1
|
air_strafe_charges + 1
|
||||||
@ -458,7 +465,7 @@ func stomp() -> void:
|
|||||||
stomping = true
|
stomping = true
|
||||||
|
|
||||||
|
|
||||||
# TOD lose_power_up function
|
# TODO lose_power_up function
|
||||||
func receive_power_up(kind: String) -> void:
|
func receive_power_up(kind: String) -> void:
|
||||||
if kind == "shield":
|
if kind == "shield":
|
||||||
$BubbleShieldViewport/IridescenceBall.visible = true
|
$BubbleShieldViewport/IridescenceBall.visible = true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user