instancing game scene

game scene is instanced instead of being hard-coded, this is the first step to being able to restart the game after getting hit.
This commit is contained in:
Red3Tango 2023-11-28 10:07:34 -07:00
parent 78349a93d6
commit 0d73d65380
3 changed files with 7 additions and 5 deletions

View File

@ -1,7 +1,12 @@
extends Node
const GAME: PackedScene = preload("res://scenes/core/game.tscn")
func _ready() -> void:
var game: Node2D = GAME.instantiate()
add_child(game)
get_tree().paused = true

View File

@ -1,14 +1,10 @@
[gd_scene load_steps=4 format=3 uid="uid://6ilcjhlwfiqk"]
[gd_scene load_steps=3 format=3 uid="uid://6ilcjhlwfiqk"]
[ext_resource type="Script" path="res://main.gd" id="1_e3c32"]
[ext_resource type="PackedScene" uid="uid://2bt2o4cubtt8" path="res://scenes/core/game.tscn" id="1_e5j8x"]
[ext_resource type="PackedScene" uid="uid://ce5br4qsu8edo" path="res://scenes/core/ui.tscn" id="3_ee1ar"]
[node name="Main" type="Node"]
process_mode = 3
script = ExtResource("1_e3c32")
[node name="Game" parent="." instance=ExtResource("1_e5j8x")]
process_mode = 1
[node name="UI" parent="." instance=ExtResource("3_ee1ar")]

View File

@ -16,6 +16,7 @@ _data = {
point_count = 5
[node name="Game" type="Node2D"]
process_mode = 1
script = ExtResource("1_x2lme")
[node name="Player" parent="." instance=ExtResource("1_jp6gs")]