Improve style in many demos (#1263)

This commit is contained in:
Aaron Franke
2025-10-11 05:03:59 -07:00
committed by GitHub
parent 0ae09b7e5a
commit 520b4a7870
197 changed files with 904 additions and 766 deletions

View File

@@ -1,6 +1,7 @@
extends Label
var is_compatibility := false
var is_compatibility: bool = false
func _ready() -> void:
@@ -12,27 +13,27 @@ func _ready() -> void:
get_node(^"../..").environment.glow_intensity = 4.0
func _input(event: InputEvent) -> void:
if event.is_action_pressed(&"toggle_pause"):
func _input(input_event: InputEvent) -> void:
if input_event.is_action_pressed(&"toggle_pause"):
get_tree().paused = not get_tree().paused
if not is_compatibility and event.is_action_pressed(&"toggle_trails"):
if not is_compatibility and input_event.is_action_pressed(&"toggle_trails"):
# Particles disappear if trail type is changed while paused.
# Prevent changing particle type while paused to avoid confusion.
for particles in get_tree().get_nodes_in_group(&"trailable_particles"):
particles.trail_enabled = not particles.trail_enabled
if not is_compatibility and event.is_action_pressed(&"increase_trail_length"):
if not is_compatibility and input_event.is_action_pressed(&"increase_trail_length"):
# Particles disappear if trail type is changed while paused.
# Prevent changing particle type while paused to avoid confusion.
for particles in get_tree().get_nodes_in_group(&"trailable_particles"):
particles.trail_lifetime = clampf(particles.trail_lifetime + 0.05, 0.1, 1.0)
if not is_compatibility and event.is_action_pressed(&"decrease_trail_length"):
if not is_compatibility and input_event.is_action_pressed(&"decrease_trail_length"):
# Particles disappear if trail type is changed while paused.
# Prevent changing particle type while paused to avoid confusion.
for particles in get_tree().get_nodes_in_group(&"trailable_particles"):
particles.trail_lifetime = clampf(particles.trail_lifetime - 0.05, 0.1, 1.0)
if event.is_action_pressed(&"toggle_glow"):
if input_event.is_action_pressed(&"toggle_glow"):
get_node(^"../..").environment.glow_enabled = not get_node(^"../..").environment.glow_enabled