godot-shooter / commit
Fixed issues when objectives are completed.
World.gd | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/World.gd b/World.gd index a433217..a9accfe 100644 --- a/World.gd +++ b/World.gd @@ -114,12 +114,12 @@ func _process(_delta: float) -> void: var all_done = completed_objectives == max_objectives if all_done: get_tree().paused = true - var score = $UI/HUD.score + var score = player.score player.add_high_score(score) var final_message = "You won with %s points!" % score - var _err = ($UI/GameFinishedMenu.find_node("Button") as Button).connect("pressed", self, "restart") - $UI/GameFinishedMenu.find_node("Label").text = final_message - $UI/GameFinishedMenu.show() + var _err = ($Player/UI/GameFinishedMenu.find_node("Button") as Button).connect("pressed", self, "restart") + $Player/UI/GameFinishedMenu.find_node("Label").text = final_message + $Player/UI/GameFinishedMenu.show() return for g in generators: @@ -209,6 +209,7 @@ func _on_Player_destination_set(position) -> void: func _on_Player_debug() -> void: - player.score += 1 - player.kill() +# player.score += 1 +# player.kill() +# completed_objectives = max_objectives pass # Replace with function body.