diff --git a/week5/README.md b/week5/README.md index 0acf0d5..e1ebe9b 100644 --- a/week5/README.md +++ b/week5/README.md @@ -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.