From 099f95f37468b14ca8172b999880a33dd3e26601 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 14 Oct 2023 00:21:31 +0200 Subject: [PATCH] Move `Spawner`s inside a `Node2D` --- game/game.gd | 6 +++--- game/game.tscn | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/game/game.gd b/game/game.gd index ef9f3ce..99b6941 100644 --- a/game/game.gd +++ b/game/game.gd @@ -2,9 +2,9 @@ extends Node2D class_name Game -@onready var button_spawner: Spawner = $ButtonSpawner -@onready var time_spawner: Spawner = $TimeSpawner -@onready var time_spawner_timer: Timer = $TimeSpawner/Timer +@onready var button_spawner: Spawner = $Spawners/ButtonSpawner +@onready var time_spawner: Spawner = $Spawners/TimeSpawner +@onready var time_spawner_timer: Timer = $Spawners/TimeSpawner/Timer @onready var store_collector: Collector = $StoreCollector @onready var store_collector_panel: Panel = $StoreCollector/Panel @onready var store_collector_texturerect: TextureRect = $StoreCollector/Panel/TextureRect diff --git a/game/game.tscn b/game/game.tscn index 024ee0c..dc8cf99 100644 --- a/game/game.tscn +++ b/game/game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=21 format=3 uid="uid://c3rxmcwa5nqng"] +[gd_scene load_steps=22 format=3 uid="uid://c3rxmcwa5nqng"] [ext_resource type="Script" path="res://game/game.gd" id="1_i3ly0"] [ext_resource type="PackedScene" uid="uid://bllsprv8orpn4" path="res://bottle/bottle.tscn" id="1_y7o2l"] @@ -14,6 +14,7 @@ [ext_resource type="Theme" uid="uid://ba5utvfhnxa5i" path="res://interface/interface_theme.tres" id="10_sayqn"] [ext_resource type="Texture2D" uid="uid://c8pvjgtr2ufjl" path="res://interface/upgrade_copper.png" id="11_lt33g"] [ext_resource type="PackedScene" uid="uid://c3kitncwpi42j" path="res://entity/coin_copper/coin_copper.tscn" id="13_4j8om"] +[ext_resource type="Script" path="res://game/DebugTimer.gd" id="13_mwigi"] [ext_resource type="PackedScene" uid="uid://qtk4tm6l367w" path="res://interface/ghost/ghost.tscn" id="16_8vhx6"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_rh35r"] @@ -86,6 +87,21 @@ metadata/_edit_lock_ = true shape = SubResource("RectangleShape2D_4uksi") debug_color = Color(0, 0.6, 0.701961, 0) +[node name="DebugSpawner" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_qwsty")] +position = Vector2(136, 0) +target = NodePath("..") +buffer_cap = 1 +spawn_rect = Rect2(-20, 0, 40, 0) +overlapping_body_count_limit = 16 +metadata/_edit_lock_ = true + +[node name="NeckShape" type="CollisionShape2D" parent="DebugSpawner"] +shape = SubResource("RectangleShape2D_4uksi") +debug_color = Color(0, 0.6, 0.701961, 0) + +[node name="DebugTimer" type="Timer" parent="DebugSpawner"] +script = ExtResource("13_mwigi") + [node name="StoreCollector" parent="." instance=ExtResource("9_evdhb")] position = Vector2(135, 0) metadata/_edit_lock_ = true @@ -167,4 +183,5 @@ debug_color = Color(0, 0, 0, 0.419608) [connection signal="changed" from="Bottle/Evaluator" to="." method="_on_score_changed"] [connection signal="timeout" from="TimeSpawner/Timer" to="TimeSpawner" method="spawn"] +[connection signal="timeout" from="DebugSpawner/DebugTimer" to="DebugSpawner" method="spawn"] [connection signal="collected" from="StoreCollector" to="." method="_on_store_collector_collected"]