diff --git a/converters/gold_to_gem/gold_converter.tscn b/converters/gold_to_gem/gold_converter.tscn index bb19811..6ebc3e4 100644 --- a/converters/gold_to_gem/gold_converter.tscn +++ b/converters/gold_to_gem/gold_converter.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=24 format=3 uid="uid://cqshgmptdav2b"] +[gd_scene load_steps=24 format=3 uid="uid://cb1t7ylnkmt3t"] [ext_resource type="Script" path="res://converters/converter.gd" id="1_fgju3"] [ext_resource type="Texture2D" uid="uid://chc8wqc1pclbk" path="res://converters/gold_to_gem/gold_converter_back.png" id="2_hh4ft"] diff --git a/converters/item_converter/item_converter.tscn b/converters/item_converter/item_converter.tscn index d5c46ec..943986e 100644 --- a/converters/item_converter/item_converter.tscn +++ b/converters/item_converter/item_converter.tscn @@ -144,6 +144,8 @@ size = Vector2(26, 8.83334) [node name="ItemConverter" type="StaticBody2D" node_paths=PackedStringArray("sprite_front", "sprite_back", "conversion_timer", "sound_working", "sound_complete", "spawner")] scale = Vector2(3, 3) +collision_layer = 8 +collision_mask = 0 script = ExtResource("1_qln0a") sprite_front = NodePath("SpriteFront") sprite_back = NodePath("SpriteBack") diff --git a/converters/silver_to_gold/silver_converter.tscn b/converters/silver_to_gold/silver_converter.tscn index f1b183f..8d7d64d 100644 --- a/converters/silver_to_gold/silver_converter.tscn +++ b/converters/silver_to_gold/silver_converter.tscn @@ -38,7 +38,7 @@ radius = 1.5 height = 28.0 [sub_resource type="RectangleShape2D" id="RectangleShape2D_31dtl"] -size = Vector2(26, 11.1667) +size = Vector2(26, 4) [sub_resource type="RectangleShape2D" id="RectangleShape2D_k11if"] size = Vector2(26, 5) diff --git a/entity/coin_copper/coin_copper.tscn b/entity/coin_copper/coin_copper.tscn index 0cb811a..3b9924f 100644 --- a/entity/coin_copper/coin_copper.tscn +++ b/entity/coin_copper/coin_copper.tscn @@ -13,7 +13,7 @@ size = Vector2(14, 3) [node name="CoinCopper" type="RigidBody2D"] collision_layer = 4 -collision_mask = 6 +collision_mask = 14 inertia = 1000.0 physics_material_override = ExtResource("1_1fypc") continuous_cd = 1 diff --git a/entity/coin_gold/coin_gold.tscn b/entity/coin_gold/coin_gold.tscn index 7e17967..bece8eb 100644 --- a/entity/coin_gold/coin_gold.tscn +++ b/entity/coin_gold/coin_gold.tscn @@ -11,7 +11,7 @@ size = Vector2(27, 5) [node name="CoinGold" type="RigidBody2D"] collision_layer = 4 -collision_mask = 6 +collision_mask = 14 mass = 2.0 inertia = 600.0 physics_material_override = ExtResource("1_nfq5t") diff --git a/entity/coin_silver/coin_silver.tscn b/entity/coin_silver/coin_silver.tscn index dc313a5..2555361 100644 --- a/entity/coin_silver/coin_silver.tscn +++ b/entity/coin_silver/coin_silver.tscn @@ -12,7 +12,7 @@ size = Vector2(21, 4) [node name="CoinSilver" type="RigidBody2D"] collision_layer = 4 -collision_mask = 6 +collision_mask = 14 mass = 1.5 inertia = 800.0 physics_material_override = ExtResource("1_4sq1a") diff --git a/entity/gem/gem.tscn b/entity/gem/gem.tscn index c5064d8..29f0f5f 100644 --- a/entity/gem/gem.tscn +++ b/entity/gem/gem.tscn @@ -10,12 +10,12 @@ [ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="6_svrnw"] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_jkfas"] -radius = 13.25 -height = 32.0 +radius = 4.0 +height = 10.0 [node name="Gem" type="RigidBody2D"] collision_layer = 4 -collision_mask = 6 +collision_mask = 14 mass = 1.5 inertia = 800.0 physics_material_override = ExtResource("1_vmemd") diff --git a/game/game.gd b/game/game.gd index 50144c4..6465c77 100644 --- a/game/game.gd +++ b/game/game.gd @@ -9,6 +9,7 @@ class_name Game @onready var store_collector_panel: Panel = $StoreCollector/Panel @onready var store_collector_texturerect: TextureRect = $StoreCollector/Panel/TextureRect @onready var store_collector_counter: Label = $StoreCollector/Panel/Label +@onready var ghost: Ghost = $Ghost func trigger_spawn(): @@ -38,6 +39,8 @@ func _on_purchase_begin(what: PurchasableItem): update_counter_icon() update_counter_text() store_collector_panel.show() + ghost.process_mode = Node.PROCESS_MODE_INHERIT + ghost.show() func _handle_purchase_success(what: PurchasableItem): what.complete_purchase() @@ -47,12 +50,16 @@ func _on_purchase_cancel(what: PurchasableItem): store_collector.collecting_types = [] store_collector.goal.disconnect(_handle_purchase_success) store_collector_panel.hide() + ghost.process_mode = Node.PROCESS_MODE_DISABLED + ghost.hide() func _on_purchase_success(what: PurchasableItem): print("[Game] Succedeed purchase of ", what.name, " costing ", what.item_cost_goal, "x ", what.item_cost_type) store_collector.collecting_types = [] store_collector.goal.disconnect(_handle_purchase_success) store_collector_panel.hide() + ghost.process_mode = Node.PROCESS_MODE_DISABLED + ghost.hide() func _on_store_collector_collected(_body: RigidBody2D): update_counter_text() diff --git a/game/game.tscn b/game/game.tscn index 5e020ac..07db436 100644 --- a/game/game.tscn +++ b/game/game.tscn @@ -42,7 +42,9 @@ upgrade_silver_texture = ExtResource("3_8wvr1") upgrade_gold_texture = ExtResource("4_i557v") [node name="Ghost" parent="." node_paths=PackedStringArray("target") instance=ExtResource("16_8vhx6")] -position = Vector2(90, 306) +process_mode = 4 +visible = false +position = Vector2(135, 360) preview_texture = ExtResource("6_0jj8g") scene_to_instantiate = ExtResource("7_ipeok") target = NodePath("..") diff --git a/spawner/spawner.gd b/spawner/spawner.gd index e7c8ba2..9a2ca0a 100644 --- a/spawner/spawner.gd +++ b/spawner/spawner.gd @@ -49,7 +49,8 @@ func _select_spawn_rotation() -> float: ) func _do_spawn(): - if len(get_overlapping_bodies()) > overlapping_body_count_limit: + var overlapping_bodies = get_overlapping_bodies() + if len(overlapping_bodies) > overlapping_body_count_limit: return var instantiated = scene.instantiate() instantiated.global_position = global_position + _select_spawn_position() diff --git a/spawner/spawner.tscn b/spawner/spawner.tscn index 50ad214..a671abf 100644 --- a/spawner/spawner.tscn +++ b/spawner/spawner.tscn @@ -3,4 +3,6 @@ [ext_resource type="Script" path="res://spawner/spawner.gd" id="1_xqfmg"] [node name="Spawner" type="Area2D"] +collision_layer = 0 +collision_mask = 4 script = ExtResource("1_xqfmg")