From 30464356aa68e8761027a5a4c05381ddf70655fe Mon Sep 17 00:00:00 2001 From: Matteo Balugani Date: Sun, 1 Oct 2023 21:58:56 +0200 Subject: [PATCH] debug things --- collector/collector.gd | 3 ++- entity/coin_copper.tscn | 3 +-- game/game.gd | 1 + game/game.tscn | 7 ++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/collector/collector.gd b/collector/collector.gd index c9a4266..d05e58b 100644 --- a/collector/collector.gd +++ b/collector/collector.gd @@ -20,13 +20,14 @@ var collected_count: int = 0 @export var collecting_amount: int ## The collector has picked up an object. -signal collected(what: PhysicsBody2D) +signal collected(body: PhysicsBody2D) ## The collector has received its collection goal and is about to reset. signal goal func _on_body_entered(body: Node2D): + if body is PhysicsBody2D: if body.collision_layer & collecting_collision_mask: var collectible: Collectible = body.get_node("Collectible") diff --git a/entity/coin_copper.tscn b/entity/coin_copper.tscn index 20fb5ea..c707d68 100644 --- a/entity/coin_copper.tscn +++ b/entity/coin_copper.tscn @@ -7,7 +7,7 @@ [ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="5_jdvvd"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_c6byl"] -size = Vector2(16, 5) +size = Vector2(16.5, 5.08333) [node name="CoinCopper" type="RigidBody2D"] collision_layer = 5 @@ -19,7 +19,6 @@ linear_damp = 0.1 angular_damp = 0.1 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -scale = Vector2(3, 3) shape = SubResource("RectangleShape2D_c6byl") [node name="Sprite" type="Sprite2D" parent="CollisionShape2D"] diff --git a/game/game.gd b/game/game.gd index e2e8253..33de062 100644 --- a/game/game.gd +++ b/game/game.gd @@ -7,3 +7,4 @@ class_name Game func trigger_spawn(): button_spawner.spawn() + diff --git a/game/game.tscn b/game/game.tscn index e5a29fd..6b12a48 100644 --- a/game/game.tscn +++ b/game/game.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=6 format=3 uid="uid://c3rxmcwa5nqng"] +[gd_scene load_steps=7 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"] [ext_resource type="PackedScene" uid="uid://d05b8jy3xmpcb" path="res://bottle/gravity_from_gyro.tscn" id="2_h2pfr"] [ext_resource type="PackedScene" uid="uid://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="3_qwsty"] [ext_resource type="PackedScene" uid="uid://c3kitncwpi42j" path="res://entity/coin_copper.tscn" id="4_e5nwi"] +[ext_resource type="PackedScene" uid="uid://ratkps4plkhl" path="res://convertors/copper_to_silver.tscn" id="6_tf2pv"] [node name="Game" type="Node2D"] texture_filter = 1 @@ -14,6 +15,10 @@ script = ExtResource("1_i3ly0") [node name="GravityFromGyro" parent="Bottle" instance=ExtResource("2_h2pfr")] +[node name="CopperToSilver" parent="." instance=ExtResource("6_tf2pv")] +z_index = 10 +position = Vector2(2, -314) + [node name="TimeSpawner" parent="." instance=ExtResource("3_qwsty")] position = Vector2(0, -480) scene = ExtResource("4_e5nwi")