1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-21 23:34:18 +00:00

Move Spawners inside a Node2D

This commit is contained in:
Steffo 2023-10-14 00:21:31 +02:00
parent b24e98e5c5
commit 099f95f374
Signed by: steffo
GPG key ID: 2A24051445686895
2 changed files with 21 additions and 4 deletions

View file

@ -2,9 +2,9 @@ extends Node2D
class_name Game class_name Game
@onready var button_spawner: Spawner = $ButtonSpawner @onready var button_spawner: Spawner = $Spawners/ButtonSpawner
@onready var time_spawner: Spawner = $TimeSpawner @onready var time_spawner: Spawner = $Spawners/TimeSpawner
@onready var time_spawner_timer: Timer = $TimeSpawner/Timer @onready var time_spawner_timer: Timer = $Spawners/TimeSpawner/Timer
@onready var store_collector: Collector = $StoreCollector @onready var store_collector: Collector = $StoreCollector
@onready var store_collector_panel: Panel = $StoreCollector/Panel @onready var store_collector_panel: Panel = $StoreCollector/Panel
@onready var store_collector_texturerect: TextureRect = $StoreCollector/Panel/TextureRect @onready var store_collector_texturerect: TextureRect = $StoreCollector/Panel/TextureRect

View file

@ -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="Script" path="res://game/game.gd" id="1_i3ly0"]
[ext_resource type="PackedScene" uid="uid://bllsprv8orpn4" path="res://bottle/bottle.tscn" id="1_y7o2l"] [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="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="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="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"] [ext_resource type="PackedScene" uid="uid://qtk4tm6l367w" path="res://interface/ghost/ghost.tscn" id="16_8vhx6"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_rh35r"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_rh35r"]
@ -86,6 +87,21 @@ metadata/_edit_lock_ = true
shape = SubResource("RectangleShape2D_4uksi") shape = SubResource("RectangleShape2D_4uksi")
debug_color = Color(0, 0.6, 0.701961, 0) 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")] [node name="StoreCollector" parent="." instance=ExtResource("9_evdhb")]
position = Vector2(135, 0) position = Vector2(135, 0)
metadata/_edit_lock_ = true 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="changed" from="Bottle/Evaluator" to="." method="_on_score_changed"]
[connection signal="timeout" from="TimeSpawner/Timer" to="TimeSpawner" method="spawn"] [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"] [connection signal="collected" from="StoreCollector" to="." method="_on_store_collector_collected"]