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

@@ -11,7 +11,7 @@
"loop": true "loop": true
} }
}, },
"properties": {"can_spawn_particles": false}, "properties": {"can_spawn_particles": true},
"variations": { "variations": {
"default": {"source": "BlueCoin.png", "rect": [0, 0, 64, 16]}, "default": {"source": "BlueCoin.png", "rect": [0, 0, 64, 16]},
"Underground": {"source": "BlueCoin.png", "rect": [0, 16, 64, 16]}, "Underground": {"source": "BlueCoin.png", "rect": [0, 16, 64, 16]},

View File

@@ -86,7 +86,7 @@
} }
}, },
"properties": { "properties": {
"can_spawn_particles": false "can_spawn_particles": true
}, },
"variations": { "variations": {
"default": {"source": "StaticCoin.png", "rect": [0, 0, 64, 16]}, "default": {"source": "StaticCoin.png", "rect": [0, 0, 64, 16]},

View File

@@ -1,5 +1,5 @@
{ {
"properties": {"can_spawn_particles": false}, "properties": {"can_spawn_particles": true},
"animations": { "animations": {
"Collected": { "Collected": {
"frames": [ "frames": [

View File

@@ -32,7 +32,7 @@
} }
}, },
"properties": { "properties": {
"can_spawn_particles": false "can_spawn_particles": true
}, },
"variations": { "variations": {
"default": { "default": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 191 B

View File

@@ -0,0 +1,9 @@
{
"properties": {
"amount": 4,
"process_material.emission_shape": 1,
"material.particles_anim_h_frames": 5,
"lifetime": 0.25
},
"variations": {"default": {"source": "SkidParticles.png"}}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bqra7e5xsdg5r"
path="res://.godot/imported/SkidParticles.png-4f132f13853c04702406f07a4c9c4263.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/Sprites/Particles/SkidParticles.png"
dest_files=["res://.godot/imported/SkidParticles.png-4f132f13853c04702406f07a4c9c4263.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=83 format=3 uid="uid://cuh62hlq8errh"] [gd_scene load_steps=85 format=3 uid="uid://cuh62hlq8errh"]
[ext_resource type="Script" uid="uid://dt4rosa5o35xr" path="res://Scripts/Classes/Entities/Player.gd" id="1_f6bau"] [ext_resource type="Script" uid="uid://dt4rosa5o35xr" path="res://Scripts/Classes/Entities/Player.gd" id="1_f6bau"]
[ext_resource type="Script" uid="uid://uribh0f1jttq" path="res://Scripts/Classes/States/StateMachine.gd" id="2_1y62l"] [ext_resource type="Script" uid="uid://uribh0f1jttq" path="res://Scripts/Classes/States/StateMachine.gd" id="2_1y62l"]
@@ -23,6 +23,7 @@
[ext_resource type="Script" uid="uid://c7kmriol0gj16" path="res://Scripts/Classes/States/Player/Climb.gd" id="10_shhao"] [ext_resource type="Script" uid="uid://c7kmriol0gj16" path="res://Scripts/Classes/States/Player/Climb.gd" id="10_shhao"]
[ext_resource type="JSON" path="res://Assets/Sprites/Players/Mario/ColourPalette.json" id="10_xy8gq"] [ext_resource type="JSON" path="res://Assets/Sprites/Players/Mario/ColourPalette.json" id="10_xy8gq"]
[ext_resource type="Script" uid="uid://b10ui1x45l6ly" path="res://Scripts/Classes/States/Player/WallSlide.gd" id="11_057py"] [ext_resource type="Script" uid="uid://b10ui1x45l6ly" path="res://Scripts/Classes/States/Player/WallSlide.gd" id="11_057py"]
[ext_resource type="Texture2D" uid="uid://bqra7e5xsdg5r" path="res://Assets/Sprites/Particles/SkidParticles.png" id="11_vijl6"]
[ext_resource type="Texture2D" uid="uid://dq58glgwf2l3" path="res://Assets/Sprites/UI/CheckpointIcon.png" id="13_uo1a1"] [ext_resource type="Texture2D" uid="uid://dq58glgwf2l3" path="res://Assets/Sprites/UI/CheckpointIcon.png" id="13_uo1a1"]
[ext_resource type="Script" uid="uid://ugfx3sb3h6rj" path="res://Scripts/Classes/States/Player/NoClip.gd" id="16_cekpg"] [ext_resource type="Script" uid="uid://ugfx3sb3h6rj" path="res://Scripts/Classes/States/Player/NoClip.gd" id="16_cekpg"]
[ext_resource type="AudioStream" uid="uid://cbxnq518x3jqe" path="res://Assets/Audio/SFX/Skid.wav" id="18_hofol"] [ext_resource type="AudioStream" uid="uid://cbxnq518x3jqe" path="res://Assets/Audio/SFX/Skid.wav" id="18_hofol"]
@@ -482,6 +483,12 @@ script = ExtResource("24_hu5lw")
Overworld = ExtResource("40_o70e0") Overworld = ExtResource("40_o70e0")
metadata/_custom_type_script = "uid://cmvlgsjmsk0v5" metadata/_custom_type_script = "uid://cmvlgsjmsk0v5"
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_pm4ir"]
particles_animation = true
particles_anim_h_frames = 5
particles_anim_v_frames = 1
particles_anim_loop = false
[node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("power_state") groups=["Players"]] [node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("power_state") groups=["Players"]]
process_priority = 1 process_priority = 1
process_physics_priority = 1 process_physics_priority = 1
@@ -1120,6 +1127,18 @@ property_name = "stream"
themed_resource = SubResource("Resource_xy8gq") themed_resource = SubResource("Resource_xy8gq")
metadata/_custom_type_script = "uid://cq6f682453q6o" metadata/_custom_type_script = "uid://cq6f682453q6o"
[node name="SkidParticles" type="CPUParticles2D" parent="."]
unique_name_in_owner = true
material = SubResource("CanvasItemMaterial_pm4ir")
position = Vector2(0, -2)
emitting = false
amount = 2
texture = ExtResource("11_vijl6")
lifetime = 0.25
gravity = Vector2(0, 0)
anim_speed_min = 1.0
anim_speed_max = 1.0
[connection signal="frame_changed" from="SpriteScaleJoint/Sprite" to="SpriteScaleJoint/Sprite" method="on_frame_changed"] [connection signal="frame_changed" from="SpriteScaleJoint/Sprite" to="SpriteScaleJoint/Sprite" method="on_frame_changed"]
[connection signal="sprite_frames_changed" from="SpriteScaleJoint/Sprite" to="SpriteScaleJoint/Sprite" method="on_frame_changed"] [connection signal="sprite_frames_changed" from="SpriteScaleJoint/Sprite" to="SpriteScaleJoint/Sprite" method="on_frame_changed"]
[connection signal="area_entered" from="SpriteScaleJoint/Sprite/HammerHitbox" to="." method="on_hammer_area_entered"] [connection signal="area_entered" from="SpriteScaleJoint/Sprite/HammerHitbox" to="." method="on_hammer_area_entered"]

View File

@@ -11,6 +11,7 @@ particles_anim_v_frames = 1
particles_anim_loop = false particles_anim_loop = false
[node name="CoinSparkle" type="CPUParticles2D"] [node name="CoinSparkle" type="CPUParticles2D"]
z_as_relative = false
material = SubResource("CanvasItemMaterial_0guw6") material = SubResource("CanvasItemMaterial_0guw6")
emitting = false emitting = false
amount = 3 amount = 3
@@ -29,11 +30,11 @@ anim_speed_max = 2.0
[node name="ResourceSetterNew" type="Node" parent="." node_paths=PackedStringArray("node_to_affect", "property_node")] [node name="ResourceSetterNew" type="Node" parent="." node_paths=PackedStringArray("node_to_affect", "property_node")]
script = ExtResource("2_sgb1m") script = ExtResource("2_sgb1m")
node_to_affect = NodePath("") node_to_affect = NodePath("..")
property_node = NodePath("") property_node = NodePath("..")
property_name = "texture" property_name = "texture"
mode = 1 mode = 1
resource_json = ExtResource("3_l0o8p") resource_json = ExtResource("3_l0o8p")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik" metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
[connection signal="ready" from="." to="." method="set_emitting"] [connection signal="ready" from="." to="." method="set_emitting" binds= [true]]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=6 format=3 uid="uid://b1ytbn4cu7msu"] [gd_scene load_steps=5 format=3 uid="uid://b1ytbn4cu7msu"]
[ext_resource type="Texture2D" uid="uid://dkebo0uw0dkkw" path="res://Assets/Sprites/Particles/CoinSparkle.png" id="1_4p5kk"] [ext_resource type="Texture2D" uid="uid://dkebo0uw0dkkw" path="res://Assets/Sprites/Particles/CoinSparkle.png" id="1_4p5kk"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="2_wdqt2"] [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="2_wdqt2"]
@@ -11,6 +11,7 @@ particles_anim_v_frames = 1
particles_anim_loop = false particles_anim_loop = false
[node name="CoinSparkle" type="CPUParticles2D"] [node name="CoinSparkle" type="CPUParticles2D"]
z_as_relative = false
material = SubResource("CanvasItemMaterial_0guw6") material = SubResource("CanvasItemMaterial_0guw6")
emitting = false emitting = false
amount = 3 amount = 3

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://ciif5kygsk0fu"] [gd_scene load_steps=5 format=3 uid="uid://ciif5kygsk0fu"]
[ext_resource type="Texture2D" uid="uid://dkebo0uw0dkkw" path="res://Assets/Sprites/Particles/CoinSparkle.png" id="1_1cy2p"] [ext_resource type="Texture2D" uid="uid://c4ugewy0lof7v" path="res://Assets/Sprites/Particles/RedCoinSparkle.png" id="1_1cy2p"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="2_4yggt"] [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="2_4yggt"]
[ext_resource type="JSON" path="res://Assets/Sprites/Particles/RedCoinSparkle.json" id="3_1cy2p"] [ext_resource type="JSON" path="res://Assets/Sprites/Particles/RedCoinSparkle.json" id="3_1cy2p"]
@@ -11,6 +11,7 @@ particles_anim_v_frames = 1
particles_anim_loop = false particles_anim_loop = false
[node name="CoinSparkle" type="CPUParticles2D"] [node name="CoinSparkle" type="CPUParticles2D"]
z_as_relative = false
material = SubResource("CanvasItemMaterial_0guw6") material = SubResource("CanvasItemMaterial_0guw6")
emitting = false emitting = false
amount = 3 amount = 3
@@ -29,11 +30,11 @@ anim_speed_max = 2.0
[node name="ResourceSetterNew" type="Node" parent="." node_paths=PackedStringArray("node_to_affect", "property_node")] [node name="ResourceSetterNew" type="Node" parent="." node_paths=PackedStringArray("node_to_affect", "property_node")]
script = ExtResource("2_4yggt") script = ExtResource("2_4yggt")
node_to_affect = NodePath("") node_to_affect = NodePath("..")
property_node = NodePath("") property_node = NodePath("..")
property_name = "texture" property_name = "texture"
mode = 1 mode = 1
resource_json = ExtResource("3_1cy2p") resource_json = ExtResource("3_1cy2p")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik" metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
[connection signal="ready" from="." to="." method="set_emitting"] [connection signal="ready" from="." to="." method="set_emitting" binds= [true]]

View File

@@ -440,7 +440,7 @@ size_flags_vertical = 3
theme_override_constants/separation = -4 theme_override_constants/separation = -4
script = ExtResource("4_avtty") script = ExtResource("4_avtty")
category_name = "SETTINGS_VISUALS" category_name = "SETTINGS_VISUALS"
options = [NodePath("ParallaxStyle"), NodePath("BGParticles"), NodePath("HUDStyle"), NodePath("RainbowEffect"), NodePath("TransformationEffect"), NodePath("TextShadows"), NodePath("BridgeDestructionAnimation"), NodePath("VisibleTimers"), NodePath("TransitionAnimation"), NodePath("ColourfulPipes"), NodePath("FirebarStyle")] options = [NodePath("ParallaxStyle"), NodePath("BGParticles"), NodePath("HUDStyle"), NodePath("RainbowEffect"), NodePath("TransformationEffect"), NodePath("TextShadows"), NodePath("BridgeDestructionAnimation"), NodePath("VisibleTimers"), NodePath("TransitionAnimation"), NodePath("ColourfulPipes"), NodePath("FirebarStyle"), NodePath("ExtraParticles")]
[node name="Control" type="Control" parent="PanelContainer/MarginContainer/VBoxContainer/Visuals"] [node name="Control" type="Control" parent="PanelContainer/MarginContainer/VBoxContainer/Visuals"]
custom_minimum_size = Vector2(0, 4) custom_minimum_size = Vector2(0, 4)
@@ -523,6 +523,13 @@ title = "FIREBAR STYLE"
values = ["Classic", "Modern"] values = ["Classic", "Modern"]
settings_category = "visuals" settings_category = "visuals"
[node name="ExtraParticles" parent="PanelContainer/MarginContainer/VBoxContainer/Visuals" groups=["Options"] instance=ExtResource("3_dl6kk")]
layout_mode = 2
option_key = "extra_particles"
title = "EXTRA EFFECTS"
values = ["SETTING_OFF", "SETTING_ON"]
settings_category = "visuals"
[node name="VisualsSetter" type="Node" parent="PanelContainer/MarginContainer/VBoxContainer/Visuals"] [node name="VisualsSetter" type="Node" parent="PanelContainer/MarginContainer/VBoxContainer/Visuals"]
script = ExtResource("9_kfq5n") script = ExtResource("9_kfq5n")
@@ -1006,6 +1013,7 @@ script = ExtResource("19_k6yev")
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Visuals/TransitionAnimation" to="PanelContainer/MarginContainer/VBoxContainer/Visuals/VisualsSetter" method="transition_style_changed"] [connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Visuals/TransitionAnimation" to="PanelContainer/MarginContainer/VBoxContainer/Visuals/VisualsSetter" method="transition_style_changed"]
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Visuals/ColourfulPipes" to="PanelContainer/MarginContainer/VBoxContainer/Visuals/VisualsSetter" method="colourful_pipes_changed"] [connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Visuals/ColourfulPipes" to="PanelContainer/MarginContainer/VBoxContainer/Visuals/VisualsSetter" method="colourful_pipes_changed"]
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Visuals/FirebarStyle" to="PanelContainer/MarginContainer/VBoxContainer/Visuals/VisualsSetter" method="firebar_style_changed"] [connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Visuals/FirebarStyle" to="PanelContainer/MarginContainer/VBoxContainer/Visuals/VisualsSetter" method="firebar_style_changed"]
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Visuals/ExtraParticles" to="PanelContainer/MarginContainer/VBoxContainer/Visuals/VisualsSetter" method="extra_particles"]
[connection signal="button_pressed" from="PanelContainer/MarginContainer/VBoxContainer/ResourcePacks/SelectableOptionNode" to="PanelContainer/MarginContainer/VBoxContainer/ResourcePacks/ResourcePackLoader" method="open_folder"] [connection signal="button_pressed" from="PanelContainer/MarginContainer/VBoxContainer/ResourcePacks/SelectableOptionNode" to="PanelContainer/MarginContainer/VBoxContainer/ResourcePacks/ResourcePackLoader" method="open_folder"]
[connection signal="button_pressed" from="PanelContainer/MarginContainer/VBoxContainer/ResourcePacks/SelectableOptionNode2" to="PanelContainer/MarginContainer/VBoxContainer/ResourcePacks/ResourcePackLoader" method="get_resource_packs"] [connection signal="button_pressed" from="PanelContainer/MarginContainer/VBoxContainer/ResourcePacks/SelectableOptionNode2" to="PanelContainer/MarginContainer/VBoxContainer/ResourcePacks/ResourcePackLoader" method="get_resource_packs"]
[connection signal="button_pressed" from="PanelContainer/MarginContainer/VBoxContainer/ResourcePacks/SelectableOptionNode3" to="ResourcePackTemplateCreator" method="create_template"] [connection signal="button_pressed" from="PanelContainer/MarginContainer/VBoxContainer/ResourcePacks/SelectableOptionNode3" to="ResourcePackTemplateCreator" method="create_template"]

View File

@@ -19,7 +19,7 @@ func collect() -> void:
DiscoLevel.combo_meter += 10 DiscoLevel.combo_meter += 10
Global.score += 200 Global.score += 200
AudioManager.play_sfx("coin", global_position) AudioManager.play_sfx("coin", global_position)
if can_spawn_particles: if can_spawn_particles and Settings.file.visuals.extra_particles == 1:
summon_particle() summon_particle()
$Sprite.queue_free() $Sprite.queue_free()
else: else:

View File

@@ -25,16 +25,14 @@ func collected() -> void:
ChallengeModeHandler.red_coins += 1 ChallengeModeHandler.red_coins += 1
Global.score += 200 Global.score += 200
ChallengeModeHandler.set_value(id, true) ChallengeModeHandler.set_value(id, true)
if can_spawn_particles: if can_spawn_particles and Settings.file.visuals.extra_particles == 1:
summon_particle() summon_particle()
$Sprite.queue_free() queue_free()
else:
queue_free()
func summon_particle() -> void: func summon_particle() -> void:
var node = COIN_SPARKLE.instantiate() var node = COIN_SPARKLE.instantiate()
node.finished.connect(queue_free) node.global_position = global_position
add_child(node) add_sibling(node)
func summon_bounced_coin() -> void: func summon_bounced_coin() -> void:
var node = SPINNING_RED_COIN.instantiate() var node = SPINNING_RED_COIN.instantiate()

View File

@@ -17,7 +17,7 @@ func _physics_process(delta: float) -> void:
velocity.y += (15 / delta) * delta velocity.y += (15 / delta) * delta
func vanish() -> void: func vanish() -> void:
if can_spawn_particles: if can_spawn_particles and Settings.file.visuals.extra_particles == 1:
summon_particle() summon_particle()
$Sprite.queue_free() $Sprite.queue_free()
else: else:

View File

@@ -28,14 +28,12 @@ func _physics_process(delta: float) -> void:
velocity.y += (15 / delta) * delta velocity.y += (15 / delta) * delta
func vanish() -> void: func vanish() -> void:
if can_spawn_particles: if can_spawn_particles and Settings.file.visuals.extra_particles == 1:
$Sprite.queue_free()
summon_particle() summon_particle()
else: queue_free()
queue_free()
func summon_particle() -> void: func summon_particle() -> void:
var node = COIN_SPARKLE.instantiate() var node = COIN_SPARKLE.instantiate()
node.finished.connect(queue_free) node.finished.connect(queue_free)
node.global_position = global_position node.global_position = $Sprite.global_position
add_sibling(node) add_sibling(node)

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 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 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 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_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 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 swim_stroke := false
var skid_frames := 0
var simulated_velocity := Vector2.ZERO var simulated_velocity := Vector2.ZERO
func _ready() -> void: func _ready() -> void:
@@ -208,6 +212,7 @@ func _ready() -> void:
camera.enabled = false camera.enabled = false
handle_power_up_states(0) handle_power_up_states(0)
set_power_state_frame() set_power_state_frame()
handle_invincible_palette()
if Global.level_editor == null: if Global.level_editor == null:
recenter_camera() recenter_camera()
@@ -280,6 +285,8 @@ func _physics_process(delta: float) -> void:
elif velocity.y > 15: elif velocity.y > 15:
can_bump_sfx = true can_bump_sfx = true
handle_water_detection() 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 $SkidSFX.playing:
if (is_actually_on_floor() and skidding) == false: if (is_actually_on_floor() and skidding) == false:
$SkidSFX.stop() $SkidSFX.stop()
@@ -716,6 +723,7 @@ func power_up_animation(new_power_state := "") -> void:
sprite.sprite_frames = old_frames sprite.sprite_frames = old_frames
await get_tree().create_timer(0.05).timeout await get_tree().create_timer(0.05).timeout
else: else:
handle_invincible_palette()
sprite.stop() sprite.stop()
sprite.material.set_shader_parameter("enabled", true) sprite.material.set_shader_parameter("enabled", true)
transforming = true transforming = true

View File

@@ -68,7 +68,8 @@ var file := {
"visible_timers": 0, "visible_timers": 0,
"transition_animation": 0, "transition_animation": 0,
"colour_pipes": 1, "colour_pipes": 1,
"firebar_style": 0 "firebar_style": 0,
"extra_particles": 0
}, },
"difficulty": "difficulty":
{ {

View File

@@ -84,7 +84,7 @@ func grounded(delta: float) -> void:
func handle_ground_movement(delta: float) -> void: func handle_ground_movement(delta: float) -> void:
if player.skidding: if player.skidding:
ground_skid(delta) ground_skid(delta)
elif (player.input_direction != player.velocity_direction) and player.input_direction != 0 and abs(player.velocity.x) > 100 and not player.crouching: elif (player.input_direction != player.velocity_direction) and player.input_direction != 0 and abs(player.velocity.x) > player.SKID_THRESHOLD and not player.crouching:
print([player.input_direction, player.velocity_direction]) print([player.input_direction, player.velocity_direction])
player.skidding = true player.skidding = true
elif player.input_direction != 0 and not player.crouching: elif player.input_direction != 0 and not player.crouching:
@@ -112,9 +112,11 @@ func deceleration(delta: float) -> void:
func ground_skid(delta: float) -> void: func ground_skid(delta: float) -> void:
var target_skid := player.RUN_SKID var target_skid := player.RUN_SKID
player.skid_frames += 1
player.velocity.x = move_toward(player.velocity.x, 1 * player.input_direction, (target_skid / delta) * delta) player.velocity.x = move_toward(player.velocity.x, 1 * player.input_direction, (target_skid / delta) * delta)
if abs(player.velocity.x) < 10 or player.input_direction == player.velocity_direction or player.input_direction == 0: if abs(player.velocity.x) < 10 or player.input_direction == player.velocity_direction or player.input_direction == 0:
player.skidding = false player.skidding = false
player.skid_frames = 0
func in_air() -> void: func in_air() -> void:
if Global.player_action_just_pressed("jump", player.player_id): if Global.player_action_just_pressed("jump", player.player_id):

View File

@@ -51,6 +51,9 @@ func transition_style_changed(new_value := 0) -> void:
func firebar_style_changed(new_value := 0) -> void: func firebar_style_changed(new_value := 0) -> void:
Settings.file.visuals.firebar_style = new_value Settings.file.visuals.firebar_style = new_value
func extra_particles(new_value := 0) -> void:
Settings.file.visuals.extra_particles = new_value
func set_value(value_name := "", value = null) -> void: func set_value(value_name := "", value = null) -> void:
{ {
"parallax_style": parallax_style_changed, "parallax_style": parallax_style_changed,
@@ -67,5 +70,6 @@ func set_value(value_name := "", value = null) -> void:
"bridge_animation": bridge_changed, "bridge_animation": bridge_changed,
"transition_animation": transform_style_changed, "transition_animation": transform_style_changed,
"colour_pipes": colourful_pipes_changed, "colour_pipes": colourful_pipes_changed,
"firebar_style": firebar_style_changed "firebar_style": firebar_style_changed,
"extra_particles": extra_particles
}[value_name].call(value) }[value_name].call(value)