skid particles + extra particles setting

This commit is contained in:
JHDev2006
2025-10-01 12:33:34 +01:00
parent d0d04c64c7
commit 9e5d7bd8e6
23 changed files with 120 additions and 30 deletions

View File

@@ -23,6 +23,8 @@ var RUN_SPEED := 160.0 # The player's speed while running, measu
var GROUND_RUN_ACCEL := 1.25 # The player's acceleration while running, measured in px/frame
var RUN_SKID := 8.0 # The player's turning deceleration while running, measured in px/frame
var SKID_THRESHOLD := 100.0 # The horizontal speed required, to be able to start skidding.
var DECEL := 3.0 # The player's deceleration while no buttons are pressed, measured in px/frame
var AIR_ACCEL := 3.0 # The player's acceleration while in midair, measured in px/frame
var AIR_SKID := 1.5 # The player's turning deceleration while in midair, measured in px/frame
@@ -182,6 +184,8 @@ static var classic_physics := false
var swim_stroke := false
var skid_frames := 0
var simulated_velocity := Vector2.ZERO
func _ready() -> void:
@@ -208,6 +212,7 @@ func _ready() -> void:
camera.enabled = false
handle_power_up_states(0)
set_power_state_frame()
handle_invincible_palette()
if Global.level_editor == null:
recenter_camera()
@@ -280,6 +285,8 @@ func _physics_process(delta: float) -> void:
elif velocity.y > 15:
can_bump_sfx = true
handle_water_detection()
%SkidParticles.visible = Settings.file.visuals.extra_particles == 1
%SkidParticles.emitting = ((skidding and skid_frames > 2) or crouching) and is_on_floor() and abs(velocity.x) > 25 and Settings.file.visuals.extra_particles == 1
if $SkidSFX.playing:
if (is_actually_on_floor() and skidding) == false:
$SkidSFX.stop()
@@ -716,6 +723,7 @@ func power_up_animation(new_power_state := "") -> void:
sprite.sprite_frames = old_frames
await get_tree().create_timer(0.05).timeout
else:
handle_invincible_palette()
sprite.stop()
sprite.material.set_shader_parameter("enabled", true)
transforming = true