add new physics parameters and descriptions

This commit is contained in:
Falkimore
2025-09-22 18:02:44 -05:00
parent d3e07180df
commit a770541ddd
3 changed files with 46 additions and 38 deletions

View File

@@ -13,7 +13,7 @@ func enter(msg := {}) -> void:
player.set_collision_mask_value(i + 1, false)
player.gravity = player.JUMP_GRAVITY
if msg["Pit"] == false:
player.velocity.y = -300
player.velocity.y = -player.DEATH_JUMP_HEIGHT
func physics_update(delta: float) -> void:
if can_fall:

View File

@@ -95,7 +95,7 @@ func handle_ground_movement(delta: float) -> void:
func ground_acceleration(delta: float) -> void:
var target_move_speed := player.WALK_SPEED
if player.in_water or player.flight_meter > 0:
target_move_speed = 45
target_move_speed = player.SWIM_GROUND_SPEED
var target_accel := player.GROUND_WALK_ACCEL
if (Global.player_action_pressed("run", player.player_id) and abs(player.velocity.x) >= player.WALK_SPEED) and (not player.in_water and player.flight_meter <= 0) and player.can_run:
target_move_speed = player.RUN_SPEED
@@ -133,14 +133,9 @@ func handle_air_movement(delta: float) -> void:
if Global.player_action_pressed("jump", player.player_id) == false and player.has_jumped and not player.jump_cancelled:
player.jump_cancelled = true
if player.gravity_vector.y > 0:
if player.velocity.y < 0:
player.velocity.y /= 1.5
player.gravity = player.FALL_GRAVITY
elif player.gravity_vector.y < 0:
if player.velocity.y > 0:
player.velocity.y /= 1.5
player.gravity = player.FALL_GRAVITY
if sign(player.gravity_vector.y * player.velocity.y) < 0.0:
player.velocity.y /= player.JUMP_CANCEL_DIVIDE
player.gravity = player.FALL_GRAVITY
func air_acceleration(delta: float) -> void:
var target_speed = player.WALK_SPEED
@@ -171,7 +166,7 @@ func swim_acceleration(delta: float) -> void:
func swim_up() -> void:
if player.swim_stroke:
player.play_animation("SwimIdle")
player.velocity.y = -100 * player.gravity_vector.y
player.velocity.y = -player.SWIM_HEIGHT * player.gravity_vector.y
AudioManager.play_sfx("swim", player.global_position)
swim_up_meter = 0.5
player.crouching = false