From 4267332d70de30efed60b3191816787b1bc69f51 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 3 Aug 2022 21:25:19 -0400 Subject: [PATCH] move the level instance to a level node so that pausing the game doesn't effect the main node --- godot/Main.tscn | 4 ++++ src/Main.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/godot/Main.tscn b/godot/Main.tscn index 24b4abe..480435f 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -5,7 +5,11 @@ [ext_resource path="res://monitor/Monitor.tscn" type="PackedScene" id=3] [node name="Main" type="Node"] +pause_mode = 2 script = ExtResource( 1 ) level = ExtResource( 2 ) +[node name="Level" type="Node" parent="."] +pause_mode = 1 + [node name="Monitor" parent="." instance=ExtResource( 3 )] diff --git a/src/Main.cpp b/src/Main.cpp index d5ff187..4ade70b 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -52,7 +52,7 @@ void Main::_ready() if (level != NULL) { - add_child(level->instance()); + get_node("Level")->add_child(level->instance()); } }