format update, additional destroy function in docs

This commit is contained in:
OddlyTimbot 2025-05-12 17:48:19 -04:00
parent 6609a5783c
commit 8a23abe2ea

View File

@ -72,6 +72,16 @@ func _on_trigger_fired(effect: Variant, body: Variant) -> void:
Now if something hits the "destroy" trigger, the game controller checks to see if it is a crate, and if so signals to destroy it. This is heard by the scene manager, who deletes the crate.
In `Scenemanager`:
```
func destroy(body):
if body is Crate:
body.queue_free()
```
Optionally, the `Scenemanager`could now count up the number of remaining crates, and tell the `Gamecontroller` how many there are.
### Example: Loading Scenes
Lets move the option to load scenes to the scene manager as well, and trigger it using a custom signal from the game controller.