7b6a141767
Move the 40-odd root-level scripts and scenes into a tree that groups by role,
per the approved roadmap (WS2/WS3): actors/{player,matador,bear}, systems/{combat,
fx,input,debug,render,crowd,config}, ui/, props/ (was tscn_s/). Rename the shell
scene.tscn -> levels/game_shell.tscn and every PascalCase scene to snake_case
(Player.tscn -> player.tscn, MainMenu.tscn -> main_menu.tscn, etc.) so the
case-insensitive web/macOS filesystems can't alias two files together.
Done as a scripted move: each file travels with its .uid; every quoted res:// path
across scenes, scripts, .tres, and project.godot's 9 autoloads is rewritten; the
.godot uid/class cache is rebuilt from scratch. Scenes still resolve by uid, so the
rewrite is belt-and-suspenders. Lint globs (run_tests.sh + both CI workflows) now
walk the new dirs; an orphan animation_tree.gd.uid and 7 pre-existing trailing-
whitespace lints (barrel/torch, never covered by the old root-only glob) are cleaned.
Full suite green on both sides. Asset consolidation (Assets/Animations/fonts ->
art/) is deferred — moving imported .glb/.png/.ttf is safer done in the editor.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017KoYBYQgRyY1zDHXMsXY3V
34 lines
1.0 KiB
GDScript
34 lines
1.0 KiB
GDScript
extends CPUParticles3D
|
|
## Root helper for a one-shot effect scene: fires this emitter (and any CPUParticles3D children)
|
|
## once when spawned, then frees the whole scene after the longest-lived particle has died. This
|
|
## is what lets an effect be nothing but a tunable CPUParticles3D scene — no per-effect code, so
|
|
## Siim owns the look entirely in the inspector. Fired by the Fx autoload; see fx/README.md.
|
|
|
|
const _FREE_MARGIN := 0.5
|
|
|
|
|
|
func _ready() -> void:
|
|
var ttl := _arm(self)
|
|
for emitter: CPUParticles3D in _child_emitters():
|
|
ttl = maxf(ttl, _arm(emitter))
|
|
get_tree().create_timer(ttl + _FREE_MARGIN).timeout.connect(queue_free)
|
|
|
|
|
|
func _arm(p: CPUParticles3D) -> float:
|
|
p.one_shot = true
|
|
p.emitting = true
|
|
return p.lifetime
|
|
|
|
|
|
func _child_emitters() -> Array[CPUParticles3D]:
|
|
var out: Array[CPUParticles3D] = []
|
|
_gather(self, out)
|
|
return out
|
|
|
|
|
|
func _gather(node: Node, out: Array[CPUParticles3D]) -> void:
|
|
for child: Node in node.get_children():
|
|
if child is CPUParticles3D:
|
|
out.append(child)
|
|
_gather(child, out)
|