diff --git a/audio/conversione/drop_in_lava.wav b/audio/conversione/drop_in_lava.wav new file mode 100644 index 0000000..5979d16 --- /dev/null +++ b/audio/conversione/drop_in_lava.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b45eadc11690c63568c572fbbc0a0a5dfb7a1fe22c5cfb06a4bdf291b634e8e0 +size 89044 diff --git a/audio/conversione/drop_in_lava.wav.import b/audio/conversione/drop_in_lava.wav.import new file mode 100644 index 0000000..54c2f36 --- /dev/null +++ b/audio/conversione/drop_in_lava.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://du16ilpv6gmxd" +path="res://.godot/imported/drop_in_lava.wav-d8564f2442e0be55cb7f8cc5bb24444b.sample" + +[deps] + +source_file="res://audio/conversione/drop_in_lava.wav" +dest_files=["res://.godot/imported/drop_in_lava.wav-d8564f2442e0be55cb7f8cc5bb24444b.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/audio/conversione/lava.wav b/audio/conversione/lava.wav new file mode 100644 index 0000000..9a321a4 --- /dev/null +++ b/audio/conversione/lava.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6226df69f9d1c013ef663c51c7da3bcd429bb06a84078a70bfd86920b57d1950 +size 591270 diff --git a/audio/conversione/lava.wav.import b/audio/conversione/lava.wav.import new file mode 100644 index 0000000..ea96b08 --- /dev/null +++ b/audio/conversione/lava.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://dv1e0wiiquxp0" +path="res://.godot/imported/lava.wav-673d1274334b931ccacf184957a397bc.sample" + +[deps] + +source_file="res://audio/conversione/lava.wav" +dest_files=["res://.godot/imported/lava.wav-673d1274334b931ccacf184957a397bc.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/audio/conversione/new_item.wav b/audio/conversione/new_item.wav new file mode 100644 index 0000000..ffee2ca --- /dev/null +++ b/audio/conversione/new_item.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e8f14d62de9a55770e67b9cfd13acf4d6ed347708bc2ef9b2a9dba32bd35fd1 +size 501320 diff --git a/audio/conversione/new_item.wav.import b/audio/conversione/new_item.wav.import new file mode 100644 index 0000000..e439ecc --- /dev/null +++ b/audio/conversione/new_item.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://c0uhi1hrejyxg" +path="res://.godot/imported/new_item.wav-c96d0e51e4b995e42ca31990475b7ff3.sample" + +[deps] + +source_file="res://audio/conversione/new_item.wav" +dest_files=["res://.godot/imported/new_item.wav-c96d0e51e4b995e42ca31990475b7ff3.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/bottle/bottle.tscn b/bottle/bottle.tscn index 4a862a0..51a532b 100644 --- a/bottle/bottle.tscn +++ b/bottle/bottle.tscn @@ -105,8 +105,8 @@ texture = ExtResource("1_qvgnf") 4:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) [sub_resource type="TileSet" id="TileSet_tr7be"] -physics_layer_0/collision_layer = 3 -physics_layer_0/collision_mask = 3 +physics_layer_0/collision_layer = 18 +physics_layer_0/collision_mask = 0 physics_layer_0/physics_material = SubResource("PhysicsMaterial_y0g3v") sources/1 = SubResource("TileSetAtlasSource_6tyce") diff --git a/bottle/placeable_area.gd b/bottle/placeable_area.gd new file mode 100644 index 0000000..4ac5220 --- /dev/null +++ b/bottle/placeable_area.gd @@ -0,0 +1,4 @@ +extends Area2D +class_name PlaceableArea + +# This script itself does nothing, it's just so that [Ghost] can identify this specific area. diff --git a/bottle/placeable_area.tscn b/bottle/placeable_area.tscn new file mode 100644 index 0000000..ac40dbf --- /dev/null +++ b/bottle/placeable_area.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=3 format=3 uid="uid://4d0al27t7axe"] + +[ext_resource type="Script" path="res://bottle/placeable_area.gd" id="1_1i0ue"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_rh35r"] +size = Vector2(240, 384) + +[node name="PlaceableArea" type="Area2D"] +position = Vector2(136, 272) +collision_layer = 16 +collision_mask = 0 +script = ExtResource("1_1i0ue") + +[node name="BottleShape" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_rh35r") +debug_color = Color(0, 0.6, 0.701961, 0) diff --git a/collector/collector.gd b/collector/collector.gd index d48486f..78f6e9a 100644 --- a/collector/collector.gd +++ b/collector/collector.gd @@ -29,7 +29,8 @@ func _on_body_entered(body: Node2D): if collectible and collectible.type in collecting_types: collected_count += 1 collectible.collect() - $sound_absorb.play() + if sound_absorb: + sound_absorb.play() emit_signal("collected", body) if collected_count >= collecting_amount: emit_signal("goal") diff --git a/converters/converter.gd b/converters/converter.gd index 5026b33..17386ef 100644 --- a/converters/converter.gd +++ b/converters/converter.gd @@ -4,6 +4,7 @@ class_name Converter var coda : int = 0 @export var sprite_front: AnimatedSprite2D +@export var sprite_back: AnimatedSprite2D @export var conversion_timer: Timer @export var sound_working: AudioStreamPlayer @export var sound_complete: AudioStreamPlayer @@ -15,12 +16,16 @@ func _on_collector_goal(): func _process(_delta): if coda>=1 and conversion_timer.is_stopped(): sprite_front.play() + if not sprite_back==null: + sprite_back.play() conversion_timer.start() sound_working.play() func _on_timer_timeout(): coda-=1 sprite_front.stop() + if not sprite_back==null: + sprite_back.stop() sound_working.stop() sound_complete.play() spawner.spawn() diff --git a/converters/converter_placement_body.tscn b/converters/converter_placement_body.tscn new file mode 100644 index 0000000..1b5f201 --- /dev/null +++ b/converters/converter_placement_body.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=3 uid="uid://bevj27e1ha8m3"] + +[ext_resource type="PackedScene" uid="uid://c3p0jdf7416ac" path="res://converters/full_converter_shape.tscn" id="1_qs7xk"] + +[node name="ConverterPlacementBody" type="StaticBody2D"] +collision_layer = 16 +collision_mask = 0 + +[node name="FullConverterShape" parent="." instance=ExtResource("1_qs7xk")] diff --git a/converters/copper_to_silver/copper_converter.tscn b/converters/copper_to_silver/copper_converter.tscn index 3cccf4a..db203d4 100644 --- a/converters/copper_to_silver/copper_converter.tscn +++ b/converters/copper_to_silver/copper_converter.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=21 format=3 uid="uid://ratkps4plkhl"] +[gd_scene load_steps=22 format=3 uid="uid://ratkps4plkhl"] [ext_resource type="Script" path="res://converters/converter.gd" id="1_mas6k"] [ext_resource type="PackedScene" uid="uid://dme22vvfgme5f" path="res://entity/coin_silver/coin_silver.tscn" id="2_h5aul"] @@ -11,6 +11,7 @@ [ext_resource type="PackedScene" uid="uid://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="9_2wvgu"] [ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="10_6hhch"] [ext_resource type="AudioStream" uid="uid://7tw5efuo3gxj" path="res://audio/conversione/coin_to_coin.wav" id="11_r8505"] +[ext_resource type="PackedScene" uid="uid://bevj27e1ha8m3" path="res://converters/converter_placement_body.tscn" id="12_5qhgs"] [sub_resource type="AtlasTexture" id="AtlasTexture_62dyi"] atlas = ExtResource("4_exnn7") @@ -59,10 +60,12 @@ size = Vector2(26, 4) size = Vector2(26, 5) [sub_resource type="RectangleShape2D" id="RectangleShape2D_jeo5f"] -size = Vector2(26, 8.83334) +size = Vector2(26, 10) [node name="CopperConverter" type="StaticBody2D" node_paths=PackedStringArray("sprite_front", "conversion_timer", "sound_working", "sound_complete", "spawner")] scale = Vector2(3, 3) +collision_layer = 8 +collision_mask = 0 script = ExtResource("1_mas6k") sprite_front = NodePath("SpriteFront") conversion_timer = NodePath("ConversionTimer") @@ -124,15 +127,14 @@ debug_color = Color(0.701961, 0, 0, 0.419608) wait_time = 0.5 one_shot = true -[node name="SoundAbsorb" type="AudioStreamPlayer" parent="."] -stream = ExtResource("10_6hhch") - [node name="SoundWorking" type="AudioStreamPlayer" parent="."] stream = ExtResource("10_6hhch") [node name="SoundComplete" type="AudioStreamPlayer" parent="."] stream = ExtResource("11_r8505") +[node name="ConverterPlacementBody" parent="." instance=ExtResource("12_5qhgs")] + [connection signal="collected" from="Collector" to="." method="_on_collector_collected"] [connection signal="goal" from="Collector" to="." method="_on_collector_goal"] [connection signal="timeout" from="ConversionTimer" to="." method="_on_timer_timeout"] diff --git a/converters/full_converter_shape.tscn b/converters/full_converter_shape.tscn new file mode 100644 index 0000000..7fcf0b0 --- /dev/null +++ b/converters/full_converter_shape.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=3 uid="uid://c3p0jdf7416ac"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_np8fu"] +size = Vector2(32, 35) + +[node name="FullConverterShape" type="CollisionShape2D"] +shape = SubResource("RectangleShape2D_np8fu") +debug_color = Color(0, 1, 1, 0) diff --git a/converters/gold_to_gem/gold_converter.png b/converters/gold_to_gem/gold_converter.png new file mode 100644 index 0000000..aa547d4 --- /dev/null +++ b/converters/gold_to_gem/gold_converter.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4a957a4a0851a9f45a45e54c278a5f1cb414e052c42a1368efbb71040f7f573 +size 5886 diff --git a/converters/gold_to_gem/gold_converter.png.import b/converters/gold_to_gem/gold_converter.png.import new file mode 100644 index 0000000..be1e0fc --- /dev/null +++ b/converters/gold_to_gem/gold_converter.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dsqe2oovfkwbv" +path="res://.godot/imported/gold_converter.png-c97ed8aabb06265133e84a8c0bb3469a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/gold_to_gem/gold_converter.png" +dest_files=["res://.godot/imported/gold_converter.png-c97ed8aabb06265133e84a8c0bb3469a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/converters/gold_to_gem/gem_converter.tscn b/converters/gold_to_gem/gold_converter.tscn similarity index 60% rename from converters/gold_to_gem/gem_converter.tscn rename to converters/gold_to_gem/gold_converter.tscn index 9c1959f..6ebc3e4 100644 --- a/converters/gold_to_gem/gem_converter.tscn +++ b/converters/gold_to_gem/gold_converter.tscn @@ -1,36 +1,37 @@ -[gd_scene load_steps=23 format=3 uid="uid://c4ew8x4gch275"] +[gd_scene load_steps=24 format=3 uid="uid://cb1t7ylnkmt3t"] -[ext_resource type="Script" path="res://converters/converter.gd" id="1_f5plk"] -[ext_resource type="Texture2D" uid="uid://bbn8t32v1ie0y" path="res://entity/gold_converter_back.png" id="2_4abgr"] -[ext_resource type="Texture2D" uid="uid://0u8wtb38l3s5" path="res://entity/gold_converter_front_1.png" id="3_rtp3d"] -[ext_resource type="Texture2D" uid="uid://bo46tom7khspd" path="res://entity/gold_converter_front_2.png" id="4_oathm"] -[ext_resource type="Texture2D" uid="uid://dclhuc7h26brj" path="res://entity/gold_converter_front_3.png" id="5_5deah"] -[ext_resource type="Texture2D" uid="uid://dn433fvnhgp5v" path="res://entity/gold_converter_front_4.png" id="6_isyc7"] -[ext_resource type="PackedScene" uid="uid://c5w3b55aiui6c" path="res://collector/collector.tscn" id="7_m34js"] -[ext_resource type="Texture2D" uid="uid://bfxmurfe4o44s" path="res://entity/gold_converter_front_5.png" id="7_w8dcp"] -[ext_resource type="PackedScene" uid="uid://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="8_qwbjp"] -[ext_resource type="PackedScene" uid="uid://du3005kwybbrh" path="res://entity/coin_gold/coin_gold.tscn" id="10_5hiv4"] -[ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="10_f1h6i"] -[ext_resource type="AudioStream" uid="uid://7tw5efuo3gxj" path="res://audio/conversione/coin_to_coin.wav" id="11_ywwn2"] +[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"] +[ext_resource type="Texture2D" uid="uid://dgw5ip5qf5k7a" path="res://converters/gold_to_gem/gold_converter_front_1.png" id="3_ofrsl"] +[ext_resource type="Texture2D" uid="uid://h7hu4paxjq84" path="res://converters/gold_to_gem/gold_converter_front_2.png" id="4_bfibv"] +[ext_resource type="Texture2D" uid="uid://dlog0f5nk4b3c" path="res://converters/gold_to_gem/gold_converter_front_3.png" id="5_grq6d"] +[ext_resource type="Texture2D" uid="uid://cj5m5k0hr3wmw" path="res://converters/gold_to_gem/gold_converter_front_4.png" id="6_m1sjp"] +[ext_resource type="Texture2D" uid="uid://b5uershakuq20" path="res://converters/gold_to_gem/gold_converter_front_5.png" id="7_ccs4f"] +[ext_resource type="PackedScene" uid="uid://c5w3b55aiui6c" path="res://collector/collector.tscn" id="8_77gmi"] +[ext_resource type="PackedScene" uid="uid://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="9_ojqfv"] +[ext_resource type="PackedScene" uid="uid://bawprh8kluilq" path="res://entity/gem/gem.tscn" id="10_op7xt"] +[ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="11_lofho"] +[ext_resource type="AudioStream" uid="uid://7tw5efuo3gxj" path="res://audio/conversione/coin_to_coin.wav" id="12_vklpo"] +[ext_resource type="PackedScene" uid="uid://bevj27e1ha8m3" path="res://converters/converter_placement_body.tscn" id="13_6o73w"] [sub_resource type="AtlasTexture" id="AtlasTexture_wy1v3"] -atlas = ExtResource("3_rtp3d") +atlas = ExtResource("3_ofrsl") region = Rect2(0, 4, 32, 31) [sub_resource type="AtlasTexture" id="AtlasTexture_2164d"] -atlas = ExtResource("4_oathm") +atlas = ExtResource("4_bfibv") region = Rect2(0, 4, 32, 31) [sub_resource type="AtlasTexture" id="AtlasTexture_i5584"] -atlas = ExtResource("5_5deah") +atlas = ExtResource("5_grq6d") region = Rect2(0, 4, 32, 31) [sub_resource type="AtlasTexture" id="AtlasTexture_qad4c"] -atlas = ExtResource("6_isyc7") +atlas = ExtResource("6_m1sjp") region = Rect2(0, 4, 32, 31) [sub_resource type="AtlasTexture" id="AtlasTexture_600qi"] -atlas = ExtResource("7_w8dcp") +atlas = ExtResource("7_ccs4f") region = Rect2(0, 4, 32, 31) [sub_resource type="SpriteFrames" id="SpriteFrames_4m3dg"] @@ -53,7 +54,7 @@ animations = [{ }], "loop": true, "name": &"default", -"speed": 15.0 +"speed": 10.5 }] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_aslkt"] @@ -69,14 +70,20 @@ size = Vector2(26, 5) [sub_resource type="RectangleShape2D" id="RectangleShape2D_jeo5f"] size = Vector2(26, 8.83334) -[node name="GemConverter" type="StaticBody2D"] -scale = Vector2(3, 3) -script = ExtResource("1_f5plk") +[node name="GoldConverter" type="StaticBody2D" node_paths=PackedStringArray("sprite_front", "conversion_timer", "sound_working", "sound_complete", "spawner")] +collision_layer = 8 +collision_mask = 0 +script = ExtResource("1_fgju3") +sprite_front = NodePath("SpriteFront") +conversion_timer = NodePath("ConversionTimer") +sound_working = NodePath("SoundWorking") +sound_complete = NodePath("SoundComplete") +spawner = NodePath("Spawner") [node name="SpriteBack" type="Sprite2D" parent="."] z_index = -2 texture_filter = 1 -texture = ExtResource("2_4abgr") +texture = ExtResource("2_hh4ft") [node name="SpriteFront" type="AnimatedSprite2D" parent="."] z_index = 2 @@ -101,7 +108,7 @@ position = Vector2(0, 4.5) rotation = 3.14159 shape = SubResource("RectangleShape2D_31dtl") -[node name="Collector" parent="." instance=ExtResource("7_m34js")] +[node name="Collector" parent="." instance=ExtResource("8_77gmi")] z_index = 2 collecting_types = Array[StringName]([&"Gold"]) collecting_amount = 10 @@ -110,9 +117,9 @@ collecting_amount = 10 shape = SubResource("RectangleShape2D_k11if") debug_color = Color(0, 0.701961, 0.188235, 0.419608) -[node name="Spawner" parent="." instance=ExtResource("8_qwbjp")] +[node name="Spawner" parent="." instance=ExtResource("9_ojqfv")] position = Vector2(0, 8) -scene = ExtResource("10_5hiv4") +scene = ExtResource("10_op7xt") buffer_cap = 1 spawn_rect = Rect2(-8, 0, 16, 4) spawn_rotation_degrees_min = 80.0 @@ -126,17 +133,18 @@ shape = SubResource("RectangleShape2D_jeo5f") debug_color = Color(0.701961, 0, 0, 0.419608) [node name="ConversionTimer" type="Timer" parent="."] -wait_time = 0.5 one_shot = true [node name="SoundAbsorb" type="AudioStreamPlayer" parent="."] -stream = ExtResource("10_f1h6i") +stream = ExtResource("11_lofho") [node name="SoundWorking" type="AudioStreamPlayer" parent="."] -stream = ExtResource("10_f1h6i") +stream = ExtResource("11_lofho") [node name="SoundComplete" type="AudioStreamPlayer" parent="."] -stream = ExtResource("11_ywwn2") +stream = ExtResource("12_vklpo") + +[node name="ConverterPlacementBody" parent="." instance=ExtResource("13_6o73w")] [connection signal="collected" from="Collector" to="." method="_on_collector_collected" flags=18] [connection signal="goal" from="Collector" to="." method="_on_collector_goal" flags=18] diff --git a/entity/gold_converter_back.png b/converters/gold_to_gem/gold_converter_back.png similarity index 100% rename from entity/gold_converter_back.png rename to converters/gold_to_gem/gold_converter_back.png diff --git a/entity/gold_converter_back.png.import b/converters/gold_to_gem/gold_converter_back.png.import similarity index 68% rename from entity/gold_converter_back.png.import rename to converters/gold_to_gem/gold_converter_back.png.import index dc5bd0d..a964061 100644 --- a/entity/gold_converter_back.png.import +++ b/converters/gold_to_gem/gold_converter_back.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://chc8wqc1pclbk" -path="res://.godot/imported/gold_converter_back.png-542530d6d643b64e20755f9b54d1da49.ctex" +path="res://.godot/imported/gold_converter_back.png-57f6151a59bebb5f4f377558fa7bed66.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/gold_converter_back.png" -dest_files=["res://.godot/imported/gold_converter_back.png-542530d6d643b64e20755f9b54d1da49.ctex"] +source_file="res://converters/gold_to_gem/gold_converter_back.png" +dest_files=["res://.godot/imported/gold_converter_back.png-57f6151a59bebb5f4f377558fa7bed66.ctex"] [params] diff --git a/entity/gold_converter_front_1.png b/converters/gold_to_gem/gold_converter_front_1.png similarity index 100% rename from entity/gold_converter_front_1.png rename to converters/gold_to_gem/gold_converter_front_1.png diff --git a/entity/gold_converter_front_1.png.import b/converters/gold_to_gem/gold_converter_front_1.png.import similarity index 67% rename from entity/gold_converter_front_1.png.import rename to converters/gold_to_gem/gold_converter_front_1.png.import index 4d62cdc..070a729 100644 --- a/entity/gold_converter_front_1.png.import +++ b/converters/gold_to_gem/gold_converter_front_1.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dgw5ip5qf5k7a" -path="res://.godot/imported/gold_converter_front_1.png-20d40342907ebeaf5453b3fbc06f6b04.ctex" +path="res://.godot/imported/gold_converter_front_1.png-8d8215c09612bfed0000441abb0b28cd.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/gold_converter_front_1.png" -dest_files=["res://.godot/imported/gold_converter_front_1.png-20d40342907ebeaf5453b3fbc06f6b04.ctex"] +source_file="res://converters/gold_to_gem/gold_converter_front_1.png" +dest_files=["res://.godot/imported/gold_converter_front_1.png-8d8215c09612bfed0000441abb0b28cd.ctex"] [params] diff --git a/entity/gold_converter_front_2.png b/converters/gold_to_gem/gold_converter_front_2.png similarity index 100% rename from entity/gold_converter_front_2.png rename to converters/gold_to_gem/gold_converter_front_2.png diff --git a/entity/gold_converter_front_2.png.import b/converters/gold_to_gem/gold_converter_front_2.png.import similarity index 67% rename from entity/gold_converter_front_2.png.import rename to converters/gold_to_gem/gold_converter_front_2.png.import index c9ca2b5..7e9f4f7 100644 --- a/entity/gold_converter_front_2.png.import +++ b/converters/gold_to_gem/gold_converter_front_2.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://h7hu4paxjq84" -path="res://.godot/imported/gold_converter_front_2.png-6b48a8121d01d35430dedd6a7ebaaed7.ctex" +path="res://.godot/imported/gold_converter_front_2.png-be7df5216327f8bc15affb3be160f525.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/gold_converter_front_2.png" -dest_files=["res://.godot/imported/gold_converter_front_2.png-6b48a8121d01d35430dedd6a7ebaaed7.ctex"] +source_file="res://converters/gold_to_gem/gold_converter_front_2.png" +dest_files=["res://.godot/imported/gold_converter_front_2.png-be7df5216327f8bc15affb3be160f525.ctex"] [params] diff --git a/entity/gold_converter_front_3.png b/converters/gold_to_gem/gold_converter_front_3.png similarity index 100% rename from entity/gold_converter_front_3.png rename to converters/gold_to_gem/gold_converter_front_3.png diff --git a/entity/gold_converter_front_3.png.import b/converters/gold_to_gem/gold_converter_front_3.png.import similarity index 67% rename from entity/gold_converter_front_3.png.import rename to converters/gold_to_gem/gold_converter_front_3.png.import index 1004753..a2e4317 100644 --- a/entity/gold_converter_front_3.png.import +++ b/converters/gold_to_gem/gold_converter_front_3.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dlog0f5nk4b3c" -path="res://.godot/imported/gold_converter_front_3.png-4b8a07d186c945c584be92c7bbbf79b8.ctex" +path="res://.godot/imported/gold_converter_front_3.png-850e0ec6590a97fe109779989afaac4a.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/gold_converter_front_3.png" -dest_files=["res://.godot/imported/gold_converter_front_3.png-4b8a07d186c945c584be92c7bbbf79b8.ctex"] +source_file="res://converters/gold_to_gem/gold_converter_front_3.png" +dest_files=["res://.godot/imported/gold_converter_front_3.png-850e0ec6590a97fe109779989afaac4a.ctex"] [params] diff --git a/entity/gold_converter_front_4.png b/converters/gold_to_gem/gold_converter_front_4.png similarity index 100% rename from entity/gold_converter_front_4.png rename to converters/gold_to_gem/gold_converter_front_4.png diff --git a/entity/gold_converter_front_4.png.import b/converters/gold_to_gem/gold_converter_front_4.png.import similarity index 67% rename from entity/gold_converter_front_4.png.import rename to converters/gold_to_gem/gold_converter_front_4.png.import index ca131bc..490966f 100644 --- a/entity/gold_converter_front_4.png.import +++ b/converters/gold_to_gem/gold_converter_front_4.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cj5m5k0hr3wmw" -path="res://.godot/imported/gold_converter_front_4.png-1dd90efaf325965268d803bbed7fda3b.ctex" +path="res://.godot/imported/gold_converter_front_4.png-16819d42eb9c86094f5063cdede729fb.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/gold_converter_front_4.png" -dest_files=["res://.godot/imported/gold_converter_front_4.png-1dd90efaf325965268d803bbed7fda3b.ctex"] +source_file="res://converters/gold_to_gem/gold_converter_front_4.png" +dest_files=["res://.godot/imported/gold_converter_front_4.png-16819d42eb9c86094f5063cdede729fb.ctex"] [params] diff --git a/entity/gold_converter_front_5.png b/converters/gold_to_gem/gold_converter_front_5.png similarity index 100% rename from entity/gold_converter_front_5.png rename to converters/gold_to_gem/gold_converter_front_5.png diff --git a/entity/gold_converter_front_5.png.import b/converters/gold_to_gem/gold_converter_front_5.png.import similarity index 67% rename from entity/gold_converter_front_5.png.import rename to converters/gold_to_gem/gold_converter_front_5.png.import index e30df37..52f6cfd 100644 --- a/entity/gold_converter_front_5.png.import +++ b/converters/gold_to_gem/gold_converter_front_5.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://b5uershakuq20" -path="res://.godot/imported/gold_converter_front_5.png-a825d75eb13b041b1a6213049c3d7637.ctex" +path="res://.godot/imported/gold_converter_front_5.png-521650e19092d447f412bf69ceea3d57.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/gold_converter_front_5.png" -dest_files=["res://.godot/imported/gold_converter_front_5.png-a825d75eb13b041b1a6213049c3d7637.ctex"] +source_file="res://converters/gold_to_gem/gold_converter_front_5.png" +dest_files=["res://.godot/imported/gold_converter_front_5.png-521650e19092d447f412bf69ceea3d57.ctex"] [params] diff --git a/converters/item_converter/item_converter.png b/converters/item_converter/item_converter.png new file mode 100644 index 0000000..464836d --- /dev/null +++ b/converters/item_converter/item_converter.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30046d84ee9ceaf7df8f5b53cfeeb529bfcb903d40a445f4aefcb3ac95bd3058 +size 5538 diff --git a/converters/item_converter/item_converter.png.import b/converters/item_converter/item_converter.png.import new file mode 100644 index 0000000..148f5d1 --- /dev/null +++ b/converters/item_converter/item_converter.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bktdm8yu8tdfn" +path="res://.godot/imported/item_converter.png-0febea25a7bcc0d0f66bd7b973ca9937.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter.png" +dest_files=["res://.godot/imported/item_converter.png-0febea25a7bcc0d0f66bd7b973ca9937.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/converters/item_converter/item_converter.tscn b/converters/item_converter/item_converter.tscn new file mode 100644 index 0000000..943986e --- /dev/null +++ b/converters/item_converter/item_converter.tscn @@ -0,0 +1,231 @@ +[gd_scene load_steps=45 format=3 uid="uid://ddrhfhebwtq5"] + +[ext_resource type="Script" path="res://converters/converter.gd" id="1_qln0a"] +[ext_resource type="Texture2D" uid="uid://devcho3gaigt0" path="res://converters/item_converter/item_converter_back_1.png" id="2_136t7"] +[ext_resource type="Texture2D" uid="uid://bq54rpw5jufyd" path="res://converters/item_converter/item_converter_back_2.png" id="3_6gyd6"] +[ext_resource type="PackedScene" uid="uid://c5w3b55aiui6c" path="res://collector/collector.tscn" id="3_qehi7"] +[ext_resource type="Texture2D" uid="uid://dsolplf1s7va6" path="res://converters/item_converter/item_converter_back_3.png" id="4_bs7n5"] +[ext_resource type="PackedScene" uid="uid://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="4_ihtl7"] +[ext_resource type="Texture2D" uid="uid://c4vpmiwjfvcpy" path="res://converters/item_converter/item_converter_back_4.png" id="5_lk4ym"] +[ext_resource type="Texture2D" uid="uid://c0kstbgsm65vq" path="res://converters/item_converter/item_converter_back_5.png" id="6_io2km"] +[ext_resource type="Texture2D" uid="uid://crnu1x5n33yqu" path="res://converters/item_converter/item_converter_front_1.png" id="7_khayw"] +[ext_resource type="Texture2D" uid="uid://b0vkliltyaljc" path="res://converters/item_converter/item_converter_front_2.png" id="8_w6rnl"] +[ext_resource type="Texture2D" uid="uid://fqerky4lyps8" path="res://converters/item_converter/item_converter_front_3.png" id="9_88mk7"] +[ext_resource type="Texture2D" uid="uid://bw0jgw0jen4lg" path="res://converters/item_converter/item_converter_front_4.png" id="10_fjv52"] +[ext_resource type="Texture2D" uid="uid://4tg81ksibacf" path="res://converters/item_converter/item_converter_front_5.png" id="11_cg5dk"] +[ext_resource type="PhysicsMaterial" uid="uid://c6kn1an85lccr" path="res://entity/coin_physics_material.tres" id="14_t5rsp"] +[ext_resource type="Texture2D" uid="uid://wpen8vmuyvqv" path="res://entity/item/item_chalice.png" id="15_4mivw"] +[ext_resource type="AudioStream" uid="uid://du16ilpv6gmxd" path="res://audio/conversione/drop_in_lava.wav" id="15_nahnf"] +[ext_resource type="Texture2D" uid="uid://dvthocklcjh15" path="res://entity/item/item_chalice_gems.png" id="16_b46dj"] +[ext_resource type="AudioStream" uid="uid://dv1e0wiiquxp0" path="res://audio/conversione/lava.wav" id="16_ptmks"] +[ext_resource type="AudioStream" uid="uid://c0uhi1hrejyxg" path="res://audio/conversione/new_item.wav" id="17_4wm4w"] +[ext_resource type="PackedScene" uid="uid://vkvtap437nnf" path="res://color/colored.tscn" id="17_ickrn"] +[ext_resource type="PackedScene" uid="uid://bevj27e1ha8m3" path="res://converters/converter_placement_body.tscn" id="17_udaa3"] +[ext_resource type="Shader" path="res://entity/gem/gem_shading_material.gdshader" id="18_36lk7"] +[ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="19_ih6j4"] +[ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="20_rkbv1"] +[ext_resource type="Script" path="res://entity/gem/RandomValue.gd" id="21_wmo4c"] +[ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="22_5s1fv"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_uqtie"] +atlas = ExtResource("2_136t7") +region = Rect2(0, 0, 32, 9) + +[sub_resource type="AtlasTexture" id="AtlasTexture_aej48"] +atlas = ExtResource("3_6gyd6") +region = Rect2(0, 0, 32, 9) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tc0dd"] +atlas = ExtResource("4_bs7n5") +region = Rect2(0, 0, 32, 9) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xunws"] +atlas = ExtResource("5_lk4ym") +region = Rect2(0, 0, 32, 9) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kf4dp"] +atlas = ExtResource("6_io2km") +region = Rect2(0, 0, 32, 9) + +[sub_resource type="SpriteFrames" id="SpriteFrames_psnir"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_uqtie") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_aej48") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tc0dd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xunws") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_kf4dp") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[sub_resource type="AtlasTexture" id="AtlasTexture_qnpyk"] +atlas = ExtResource("7_khayw") +region = Rect2(0, 5, 32, 27) + +[sub_resource type="AtlasTexture" id="AtlasTexture_m7447"] +atlas = ExtResource("8_w6rnl") +region = Rect2(0, 5, 32, 27) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5cwul"] +atlas = ExtResource("9_88mk7") +region = Rect2(0, 5, 32, 27) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ee880"] +atlas = ExtResource("10_fjv52") +region = Rect2(0, 5, 32, 27) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qs650"] +atlas = ExtResource("11_cg5dk") +region = Rect2(0, 5, 32, 27) + +[sub_resource type="SpriteFrames" id="SpriteFrames_qqah4"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_qnpyk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_m7447") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5cwul") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ee880") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qs650") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_aslkt"] +radius = 1.5 +height = 28.0 + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_31dtl"] +size = Vector2(26, 4) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_k11if"] +size = Vector2(26, 5) + +[sub_resource type="CircleShape2D" id="CircleShape2D_hwdjv"] +radius = 18.5017 + +[sub_resource type="PackedScene" id="PackedScene_srx0t"] +_bundled = { +"conn_count": 1, +"conns": PackedInt32Array(5, 5, 30, 29, 18, 0, 0), +"editable_instances": [], +"names": PackedStringArray("Item", "collision_layer", "collision_mask", "mass", "inertia", "physics_material_override", "continuous_cd", "linear_damp", "angular_damp", "RigidBody2D", "CollisionShape2D", "scale", "shape", "Sprite2D", "texture_filter", "texture", "Sprite", "Colored", "shader", "Collectible", "type", "Valuable", "value", "RandomValue", "script", "Node", "SoundWorking", "stream", "AudioStreamPlayer", "_on_done", "collected"), +"node_count": 9, +"node_paths": [], +"nodes": PackedInt32Array(-1, -1, 9, 0, -1, 8, 1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 6, 0, 0, 0, 10, 10, -1, 2, 11, 7, 12, 8, 0, 1, 0, 13, 13, -1, 2, 14, 5, 15, 9, 0, 1, 0, 13, 16, -1, 2, 14, 5, 15, 10, 0, 3, 0, 2147483647, 17, 11, 1, 18, 12, 0, 0, 0, 2147483647, 19, 13, 1, 20, 14, 0, 0, 0, 2147483647, 21, 15, 1, 22, 16, 0, 6, 0, 25, 23, -1, 1, 24, 17, 0, 0, 0, 28, 26, -1, 1, 27, 18, 0), +"variants": [5, 7, 1.5, 800.0, ExtResource("14_t5rsp"), 1, 0.1, Vector2(4, 4), SubResource("CircleShape2D_hwdjv"), ExtResource("15_4mivw"), ExtResource("16_b46dj"), ExtResource("17_ickrn"), ExtResource("18_36lk7"), ExtResource("19_ih6j4"), &"Gem", ExtResource("20_rkbv1"), 10, ExtResource("21_wmo4c"), ExtResource("22_5s1fv")], +"version": 3 +} + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_jeo5f"] +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") +conversion_timer = NodePath("ConversionTimer") +sound_working = NodePath("SoundWorking") +sound_complete = NodePath("SoundComplete") +spawner = NodePath("Spawner") + +[node name="SpriteBack" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +position = Vector2(0, -14) +sprite_frames = SubResource("SpriteFrames_psnir") +frame_progress = 0.883907 + +[node name="SpriteFront" type="AnimatedSprite2D" parent="."] +z_index = 2 +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_qqah4") + +[node name="LeftWall" type="CollisionShape2D" parent="."] +z_index = 2 +position = Vector2(-14.5, -3) +shape = SubResource("CapsuleShape2D_aslkt") + +[node name="RightWall" type="CollisionShape2D" parent="."] +z_index = 2 +position = Vector2(14.5, -3) +shape = SubResource("CapsuleShape2D_aslkt") + +[node name="InnerWall" type="CollisionShape2D" parent="."] +z_index = 3 +position = Vector2(0, 4.5) +rotation = 3.14159 +shape = SubResource("RectangleShape2D_31dtl") + +[node name="Collector" parent="." node_paths=PackedStringArray("sound_absorb") instance=ExtResource("3_qehi7")] +z_index = 2 +collecting_types = Array[StringName]([&"Gold", &"Gem"]) +sound_absorb = NodePath("../SoundAbsorb") +collecting_amount = 10 + +[node name="CollectShape" type="CollisionShape2D" parent="Collector"] +shape = SubResource("RectangleShape2D_k11if") +debug_color = Color(0, 0.701961, 0.188235, 0.419608) + +[node name="Spawner" parent="." instance=ExtResource("4_ihtl7")] +position = Vector2(0, 8) +scene = SubResource("PackedScene_srx0t") +buffer_cap = 1 +spawn_rect = Rect2(-8, 0, 16, 4) +spawn_rotation_degrees_min = 80.0 +spawn_rotation_degrees_max = 100.0 +overlapping_body_count_limit = 4 + +[node name="PreventSpawnShape" type="CollisionShape2D" parent="Spawner"] +z_index = 3 +position = Vector2(0, 3.5) +shape = SubResource("RectangleShape2D_jeo5f") +debug_color = Color(0.701961, 0, 0, 0.419608) + +[node name="ConversionTimer" type="Timer" parent="."] +one_shot = true + +[node name="SoundAbsorb" type="AudioStreamPlayer" parent="."] +stream = ExtResource("15_nahnf") +volume_db = -12.291 + +[node name="SoundWorking" type="AudioStreamPlayer" parent="."] +stream = ExtResource("16_ptmks") + +[node name="SoundComplete" type="AudioStreamPlayer" parent="."] +stream = ExtResource("17_4wm4w") + +[node name="SpriteBack2" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_psnir") +frame_progress = 0.228399 + +[node name="ConverterPlacementBody" parent="." instance=ExtResource("17_udaa3")] + +[connection signal="collected" from="Collector" to="." method="_on_collector_collected" flags=18] +[connection signal="goal" from="Collector" to="." method="_on_collector_goal" flags=18] +[connection signal="timeout" from="ConversionTimer" to="." method="_on_timer_timeout" flags=18] diff --git a/entity/item_converter_back_1.png b/converters/item_converter/item_converter_back_1.png similarity index 100% rename from entity/item_converter_back_1.png rename to converters/item_converter/item_converter_back_1.png diff --git a/converters/item_converter/item_converter_back_1.png.import b/converters/item_converter/item_converter_back_1.png.import new file mode 100644 index 0000000..fb4fdb2 --- /dev/null +++ b/converters/item_converter/item_converter_back_1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://devcho3gaigt0" +path="res://.godot/imported/item_converter_back_1.png-02fb6c676f39604a12591aa253536bdc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter_back_1.png" +dest_files=["res://.godot/imported/item_converter_back_1.png-02fb6c676f39604a12591aa253536bdc.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entity/item_converter_back_2.png b/converters/item_converter/item_converter_back_2.png similarity index 100% rename from entity/item_converter_back_2.png rename to converters/item_converter/item_converter_back_2.png diff --git a/converters/item_converter/item_converter_back_2.png.import b/converters/item_converter/item_converter_back_2.png.import new file mode 100644 index 0000000..d5b6232 --- /dev/null +++ b/converters/item_converter/item_converter_back_2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bq54rpw5jufyd" +path="res://.godot/imported/item_converter_back_2.png-4185f44143b834d6b4de21c37ed10c7a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter_back_2.png" +dest_files=["res://.godot/imported/item_converter_back_2.png-4185f44143b834d6b4de21c37ed10c7a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entity/item_converter_back_3.png b/converters/item_converter/item_converter_back_3.png similarity index 100% rename from entity/item_converter_back_3.png rename to converters/item_converter/item_converter_back_3.png diff --git a/converters/item_converter/item_converter_back_3.png.import b/converters/item_converter/item_converter_back_3.png.import new file mode 100644 index 0000000..d7ef522 --- /dev/null +++ b/converters/item_converter/item_converter_back_3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dsolplf1s7va6" +path="res://.godot/imported/item_converter_back_3.png-54c120abb9e3422ebcfe32b932dbc251.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter_back_3.png" +dest_files=["res://.godot/imported/item_converter_back_3.png-54c120abb9e3422ebcfe32b932dbc251.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entity/item_converter_back_4.png b/converters/item_converter/item_converter_back_4.png similarity index 100% rename from entity/item_converter_back_4.png rename to converters/item_converter/item_converter_back_4.png diff --git a/converters/item_converter/item_converter_back_4.png.import b/converters/item_converter/item_converter_back_4.png.import new file mode 100644 index 0000000..7f3a43f --- /dev/null +++ b/converters/item_converter/item_converter_back_4.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c4vpmiwjfvcpy" +path="res://.godot/imported/item_converter_back_4.png-1c9f35db5b4a349a668f18d5214b2727.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter_back_4.png" +dest_files=["res://.godot/imported/item_converter_back_4.png-1c9f35db5b4a349a668f18d5214b2727.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entity/item_converter_back_5.png b/converters/item_converter/item_converter_back_5.png similarity index 100% rename from entity/item_converter_back_5.png rename to converters/item_converter/item_converter_back_5.png diff --git a/converters/item_converter/item_converter_back_5.png.import b/converters/item_converter/item_converter_back_5.png.import new file mode 100644 index 0000000..b1dae29 --- /dev/null +++ b/converters/item_converter/item_converter_back_5.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c0kstbgsm65vq" +path="res://.godot/imported/item_converter_back_5.png-42bccf2648ac72639c3222e782973419.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter_back_5.png" +dest_files=["res://.godot/imported/item_converter_back_5.png-42bccf2648ac72639c3222e782973419.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entity/item_converter_front_1.png b/converters/item_converter/item_converter_front_1.png similarity index 100% rename from entity/item_converter_front_1.png rename to converters/item_converter/item_converter_front_1.png diff --git a/converters/item_converter/item_converter_front_1.png.import b/converters/item_converter/item_converter_front_1.png.import new file mode 100644 index 0000000..aed1574 --- /dev/null +++ b/converters/item_converter/item_converter_front_1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://crnu1x5n33yqu" +path="res://.godot/imported/item_converter_front_1.png-dd1daf8a9c0a510530b499678f35b24b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter_front_1.png" +dest_files=["res://.godot/imported/item_converter_front_1.png-dd1daf8a9c0a510530b499678f35b24b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entity/item_converter_front_2.png b/converters/item_converter/item_converter_front_2.png similarity index 100% rename from entity/item_converter_front_2.png rename to converters/item_converter/item_converter_front_2.png diff --git a/converters/item_converter/item_converter_front_2.png.import b/converters/item_converter/item_converter_front_2.png.import new file mode 100644 index 0000000..b41d7fe --- /dev/null +++ b/converters/item_converter/item_converter_front_2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b0vkliltyaljc" +path="res://.godot/imported/item_converter_front_2.png-94c58f1e66500054fedc8d146ac34825.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter_front_2.png" +dest_files=["res://.godot/imported/item_converter_front_2.png-94c58f1e66500054fedc8d146ac34825.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entity/item_converter_front_3.png b/converters/item_converter/item_converter_front_3.png similarity index 100% rename from entity/item_converter_front_3.png rename to converters/item_converter/item_converter_front_3.png diff --git a/converters/item_converter/item_converter_front_3.png.import b/converters/item_converter/item_converter_front_3.png.import new file mode 100644 index 0000000..4599bc0 --- /dev/null +++ b/converters/item_converter/item_converter_front_3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://fqerky4lyps8" +path="res://.godot/imported/item_converter_front_3.png-094b9f361323b52b8091796ebea8ef3c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter_front_3.png" +dest_files=["res://.godot/imported/item_converter_front_3.png-094b9f361323b52b8091796ebea8ef3c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entity/item_converter_front_4.png b/converters/item_converter/item_converter_front_4.png similarity index 100% rename from entity/item_converter_front_4.png rename to converters/item_converter/item_converter_front_4.png diff --git a/converters/item_converter/item_converter_front_4.png.import b/converters/item_converter/item_converter_front_4.png.import new file mode 100644 index 0000000..c1b482f --- /dev/null +++ b/converters/item_converter/item_converter_front_4.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bw0jgw0jen4lg" +path="res://.godot/imported/item_converter_front_4.png-2fe2de3df3bc903bb82ba4c361a76624.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter_front_4.png" +dest_files=["res://.godot/imported/item_converter_front_4.png-2fe2de3df3bc903bb82ba4c361a76624.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entity/item_converter_front_5.png b/converters/item_converter/item_converter_front_5.png similarity index 100% rename from entity/item_converter_front_5.png rename to converters/item_converter/item_converter_front_5.png diff --git a/converters/item_converter/item_converter_front_5.png.import b/converters/item_converter/item_converter_front_5.png.import new file mode 100644 index 0000000..f5e2e0b --- /dev/null +++ b/converters/item_converter/item_converter_front_5.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://4tg81ksibacf" +path="res://.godot/imported/item_converter_front_5.png-8ae35893cd89f1f98246039909bd75cb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://converters/item_converter/item_converter_front_5.png" +dest_files=["res://.godot/imported/item_converter_front_5.png-8ae35893cd89f1f98246039909bd75cb.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/converters/silver_to_gold/silver_converter.tscn b/converters/silver_to_gold/silver_converter.tscn index 3a33122..8d7d64d 100644 --- a/converters/silver_to_gold/silver_converter.tscn +++ b/converters/silver_to_gold/silver_converter.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=3 uid="uid://but1bdslxp5jl"] +[gd_scene load_steps=18 format=3 uid="uid://but1bdslxp5jl"] [ext_resource type="Script" path="res://converters/converter.gd" id="1_chhfg"] [ext_resource type="Texture2D" uid="uid://c1fu70mb51gyd" path="res://converters/silver_to_gold/silver_converter_back.png" id="2_rpdc3"] @@ -11,6 +11,7 @@ [ext_resource type="PackedScene" uid="uid://du3005kwybbrh" path="res://entity/coin_gold/coin_gold.tscn" id="9_t8y3t"] [ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="10_0dr47"] [ext_resource type="AudioStream" uid="uid://7tw5efuo3gxj" path="res://audio/conversione/coin_to_coin.wav" id="11_ow0vy"] +[ext_resource type="PackedScene" uid="uid://bevj27e1ha8m3" path="res://converters/converter_placement_body.tscn" id="12_37x2h"] [sub_resource type="SpriteFrames" id="SpriteFrames_1qp6y"] animations = [{ @@ -47,6 +48,8 @@ size = Vector2(26, 10) [node name="SilverConverter" type="StaticBody2D" node_paths=PackedStringArray("sprite_front", "conversion_timer", "sound_working", "sound_complete", "spawner")] scale = Vector2(3, 3) +collision_layer = 8 +collision_mask = 0 script = ExtResource("1_chhfg") sprite_front = NodePath("SpriteFront") conversion_timer = NodePath("ConversionTimer") @@ -116,6 +119,8 @@ stream = ExtResource("10_0dr47") [node name="SoundComplete" type="AudioStreamPlayer" parent="."] stream = ExtResource("11_ow0vy") +[node name="ConverterPlacementBody" parent="." instance=ExtResource("12_37x2h")] + [connection signal="collected" from="Collector" to="." method="_on_collector_collected"] [connection signal="goal" from="Collector" to="." method="_on_collector_goal"] [connection signal="timeout" from="ConversionTimer" to="." method="_on_timer_timeout"] diff --git a/entity/coin_copper/coin_copper.gd b/entity/coin_copper/coin_copper.gd deleted file mode 100644 index 594d523..0000000 --- a/entity/coin_copper/coin_copper.gd +++ /dev/null @@ -1,38 +0,0 @@ -#extends RigidBody2D -# -# -## Called when the node enters the scene tree for the first time. -#func _ready(): -# pass # Replace with function body. -# -# -## Called every frame. 'delta' is the elapsed time since the previous frame. - - -extends RigidBody2D - -@export var sound_touch: AudioStreamPlayer - -var touched=false -var was_sleeping: bool = false - -func set_touched(): - touched=true - -func _on_sleeping_state_changed(): - was_sleeping = true - -func _on_body_entered(body): - if not was_sleeping: - if touched==false and $Timer.is_stopped(): - #$sound_touch.play() - $Timer.start() - var other_node=body - if other_node.has_method("set_touched"): - other_node.set_touched() - -func _on_body_exited(body): - touched=false - - - diff --git a/entity/coin_copper/coin_copper.tscn b/entity/coin_copper/coin_copper.tscn index 08850eb..99d56e2 100644 --- a/entity/coin_copper/coin_copper.tscn +++ b/entity/coin_copper/coin_copper.tscn @@ -1,19 +1,18 @@ -[gd_scene load_steps=9 format=3 uid="uid://c3kitncwpi42j"] +[gd_scene load_steps=8 format=3 uid="uid://c3kitncwpi42j"] [ext_resource type="PhysicsMaterial" uid="uid://c6kn1an85lccr" path="res://entity/coin_physics_material.tres" id="1_1fypc"] -[ext_resource type="Script" path="res://entity/coin_copper/coin_copper.gd" id="2_1r8w3"] [ext_resource type="Texture2D" uid="uid://dbdkb4vt7dh85" path="res://entity/coin_copper/coin_copper_4.png" id="2_4pvkj"] [ext_resource type="Texture2D" uid="uid://2vtvoj6ua3cb" path="res://entity/coin_copper/coin_copper_outline_2.png" id="3_dq1f7"] [ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="4_npwn2"] [ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="5_fd0r7"] -[ext_resource type="AudioStream" uid="uid://wy7f2j0wg1ur" path="res://audio/tap/click5.wav" id="7_fxd28"] +[ext_resource type="AudioStream" uid="uid://ds2rl6eg5jr1" path="res://audio/tap/click5.wav" id="7_fxd28"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_c6byl"] size = Vector2(14, 3) -[node name="CoinCopper" type="RigidBody2D" node_paths=PackedStringArray("sound_touch")] -collision_layer = 5 -collision_mask = 7 +[node name="CoinCopper" type="RigidBody2D"] +collision_layer = 4 +collision_mask = 14 inertia = 1000.0 physics_material_override = ExtResource("1_1fypc") continuous_cd = 1 @@ -21,8 +20,6 @@ max_contacts_reported = 1 contact_monitor = true linear_damp = 0.1 angular_damp = 0.1 -script = ExtResource("2_1r8w3") -sound_touch = NodePath("sound_touch") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] scale = Vector2(2, 2) diff --git a/entity/coin_gold/coin_gold.tscn b/entity/coin_gold/coin_gold.tscn index be8c158..bece8eb 100644 --- a/entity/coin_gold/coin_gold.tscn +++ b/entity/coin_gold/coin_gold.tscn @@ -10,8 +10,8 @@ size = Vector2(27, 5) [node name="CoinGold" type="RigidBody2D"] -collision_layer = 5 -collision_mask = 7 +collision_layer = 4 +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 8141872..2555361 100644 --- a/entity/coin_silver/coin_silver.tscn +++ b/entity/coin_silver/coin_silver.tscn @@ -11,8 +11,8 @@ size = Vector2(21, 4) [node name="CoinSilver" type="RigidBody2D"] -collision_layer = 5 -collision_mask = 7 +collision_layer = 4 +collision_mask = 14 mass = 1.5 inertia = 800.0 physics_material_override = ExtResource("1_4sq1a") diff --git a/entity/gem/RandomValue.gd b/entity/gem/RandomValue.gd index 3b76b51..e72ea7a 100644 --- a/entity/gem/RandomValue.gd +++ b/entity/gem/RandomValue.gd @@ -1,4 +1,9 @@ extends Node + +@export var min_value: int +@export var max_value: int + + func _ready(): - get_parent().value=Randomizer.rng.randi_range(0,360) + get_parent().value = Randomizer.rng.randi_range(min_value, max_value) diff --git a/entity/gem/gem.tscn b/entity/gem/gem.tscn index 9bce7f2..08cd7e6 100644 --- a/entity/gem/gem.tscn +++ b/entity/gem/gem.tscn @@ -14,8 +14,8 @@ radius = 4.0 height = 10.0 [node name="Gem" type="RigidBody2D"] -collision_layer = 5 -collision_mask = 7 +collision_layer = 4 +collision_mask = 14 mass = 1.5 inertia = 800.0 physics_material_override = ExtResource("1_vmemd") @@ -24,7 +24,7 @@ linear_damp = 0.1 angular_damp = 0.1 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -scale = Vector2(2, 2) +scale = Vector2(4, 4) shape = SubResource("CapsuleShape2D_jkfas") [node name="Sprite" type="Sprite2D" parent="CollisionShape2D"] @@ -35,13 +35,15 @@ texture = ExtResource("3_6jejy") shader = ExtResource("5_v6ppl") [node name="Collectible" parent="." instance=ExtResource("4_idoeu")] -type = &"Silver" +type = &"Gem" [node name="Valuable" parent="." instance=ExtResource("5_7bd6c")] -value = 10 +value = 1000 [node name="RandomValue" type="Node" parent="Valuable"] script = ExtResource("6_3lulr") +min_value = 900 +max_value = 1300 [node name="SoundWorking" type="AudioStreamPlayer" parent="."] stream = ExtResource("6_svrnw") diff --git a/entity/gem/gemstone.gdshader b/entity/gem/gemstone.gdshader new file mode 100644 index 0000000..e69de29 diff --git a/entity/item_chalice.png b/entity/item/item_chalice.png similarity index 100% rename from entity/item_chalice.png rename to entity/item/item_chalice.png diff --git a/entity/item_chalice.png.import b/entity/item/item_chalice.png.import similarity index 71% rename from entity/item_chalice.png.import rename to entity/item/item_chalice.png.import index 38ad128..efe43b8 100644 --- a/entity/item_chalice.png.import +++ b/entity/item/item_chalice.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://wpen8vmuyvqv" -path="res://.godot/imported/item_chalice.png-7c6bf5aba6af81724e4a9b47b0fa9097.ctex" +path="res://.godot/imported/item_chalice.png-c5df7a19dd55b2ba93c6d0a5ed67bc40.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/item_chalice.png" -dest_files=["res://.godot/imported/item_chalice.png-7c6bf5aba6af81724e4a9b47b0fa9097.ctex"] +source_file="res://entity/item/item_chalice.png" +dest_files=["res://.godot/imported/item_chalice.png-c5df7a19dd55b2ba93c6d0a5ed67bc40.ctex"] [params] diff --git a/entity/item/item_chalice.tscn b/entity/item/item_chalice.tscn new file mode 100644 index 0000000..0c7bb12 --- /dev/null +++ b/entity/item/item_chalice.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=11 format=3 uid="uid://451ddbtq4163"] + +[ext_resource type="PhysicsMaterial" uid="uid://c6kn1an85lccr" path="res://entity/coin_physics_material.tres" id="1_vp2el"] +[ext_resource type="Texture2D" uid="uid://wpen8vmuyvqv" path="res://entity/item/item_chalice.png" id="2_rnc33"] +[ext_resource type="Texture2D" uid="uid://dvthocklcjh15" path="res://entity/item/item_chalice_gems.png" id="3_crdaw"] +[ext_resource type="PackedScene" uid="uid://vkvtap437nnf" path="res://color/colored.tscn" id="4_n40wg"] +[ext_resource type="Shader" path="res://entity/gem/gem_shading_material.gdshader" id="5_bkxhb"] +[ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="6_eanc2"] +[ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="7_0qpb5"] +[ext_resource type="Script" path="res://entity/gem/RandomValue.gd" id="8_87qrp"] +[ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="9_v6jws"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_6xf6v"] +radius = 12.95 +height = 42.31 + +[node name="ItemChalice" type="RigidBody2D"] +collision_layer = 5 +collision_mask = 7 +mass = 1.5 +inertia = 800.0 +physics_material_override = ExtResource("1_vp2el") +continuous_cd = 1 +linear_damp = 0.1 +angular_damp = 0.1 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +scale = Vector2(4, 4) +shape = SubResource("CapsuleShape2D_6xf6v") + +[node name="Sprite2D" type="Sprite2D" parent="CollisionShape2D"] +texture_filter = 1 +texture = ExtResource("2_rnc33") + +[node name="Sprite" type="Sprite2D" parent="CollisionShape2D"] +texture_filter = 1 +texture = ExtResource("3_crdaw") + +[node name="Colored" parent="CollisionShape2D/Sprite" instance=ExtResource("4_n40wg")] +shader = ExtResource("5_bkxhb") + +[node name="Collectible" parent="." instance=ExtResource("6_eanc2")] +type = &"Gem" + +[node name="Valuable" parent="." instance=ExtResource("7_0qpb5")] +value = 10 + +[node name="RandomValue" type="Node" parent="Valuable"] +script = ExtResource("8_87qrp") + +[node name="SoundWorking" type="AudioStreamPlayer" parent="."] +stream = ExtResource("9_v6jws") + +[connection signal="collected" from="Collectible" to="Collectible" method="_on_done" flags=18] diff --git a/entity/item_chalice_gems.png b/entity/item/item_chalice_gems.png similarity index 100% rename from entity/item_chalice_gems.png rename to entity/item/item_chalice_gems.png diff --git a/entity/item_chalice_gems.png.import b/entity/item/item_chalice_gems.png.import similarity index 69% rename from entity/item_chalice_gems.png.import rename to entity/item/item_chalice_gems.png.import index 4fe9136..c076327 100644 --- a/entity/item_chalice_gems.png.import +++ b/entity/item/item_chalice_gems.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dvthocklcjh15" -path="res://.godot/imported/item_chalice_gems.png-182c84a35d2925a897cade98742ac714.ctex" +path="res://.godot/imported/item_chalice_gems.png-00db24473f6cbe288664e42289ba7c68.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/item_chalice_gems.png" -dest_files=["res://.godot/imported/item_chalice_gems.png-182c84a35d2925a897cade98742ac714.ctex"] +source_file="res://entity/item/item_chalice_gems.png" +dest_files=["res://.godot/imported/item_chalice_gems.png-00db24473f6cbe288664e42289ba7c68.ctex"] [params] diff --git a/entity/item_crown.png b/entity/item/item_crown.png similarity index 100% rename from entity/item_crown.png rename to entity/item/item_crown.png diff --git a/entity/item_crown.png.import b/entity/item/item_crown.png.import similarity index 71% rename from entity/item_crown.png.import rename to entity/item/item_crown.png.import index bae9b5b..117819b 100644 --- a/entity/item_crown.png.import +++ b/entity/item/item_crown.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://brlo5pqo0x86l" -path="res://.godot/imported/item_crown.png-b1fdb9663d17347d4fbd39044017f645.ctex" +path="res://.godot/imported/item_crown.png-79b26b3e29df09fdd86d05f7fb7107d2.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/item_crown.png" -dest_files=["res://.godot/imported/item_crown.png-b1fdb9663d17347d4fbd39044017f645.ctex"] +source_file="res://entity/item/item_crown.png" +dest_files=["res://.godot/imported/item_crown.png-79b26b3e29df09fdd86d05f7fb7107d2.ctex"] [params] diff --git a/entity/item/item_crown.tscn b/entity/item/item_crown.tscn new file mode 100644 index 0000000..fcafaaa --- /dev/null +++ b/entity/item/item_crown.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=11 format=3 uid="uid://d32fgw4klo4x3"] + +[ext_resource type="PhysicsMaterial" uid="uid://c6kn1an85lccr" path="res://entity/coin_physics_material.tres" id="1_j1ug7"] +[ext_resource type="Texture2D" uid="uid://brlo5pqo0x86l" path="res://entity/item/item_crown.png" id="2_4mgp8"] +[ext_resource type="Texture2D" uid="uid://l7kr24oe0fc8" path="res://entity/item/item_crown_gems.png" id="3_cpnmq"] +[ext_resource type="PackedScene" uid="uid://vkvtap437nnf" path="res://color/colored.tscn" id="4_ttx03"] +[ext_resource type="Shader" path="res://entity/gem/gem_shading_material.gdshader" id="5_c6qlx"] +[ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="6_4lslk"] +[ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="7_7rpe6"] +[ext_resource type="Script" path="res://entity/gem/RandomValue.gd" id="8_utkrs"] +[ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="9_6xmfi"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_jkfas"] +radius = 13.25 +height = 32.0 + +[node name="ItemCrown" type="RigidBody2D"] +collision_layer = 5 +collision_mask = 7 +mass = 1.5 +inertia = 800.0 +physics_material_override = ExtResource("1_j1ug7") +continuous_cd = 1 +linear_damp = 0.1 +angular_damp = 0.1 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +scale = Vector2(4, 4) +shape = SubResource("CapsuleShape2D_jkfas") + +[node name="Sprite2D" type="Sprite2D" parent="CollisionShape2D"] +texture_filter = 1 +texture = ExtResource("2_4mgp8") + +[node name="Sprite" type="Sprite2D" parent="CollisionShape2D"] +texture_filter = 1 +texture = ExtResource("3_cpnmq") + +[node name="Colored" parent="CollisionShape2D/Sprite" instance=ExtResource("4_ttx03")] +shader = ExtResource("5_c6qlx") + +[node name="Collectible" parent="." instance=ExtResource("6_4lslk")] +type = &"Gem" + +[node name="Valuable" parent="." instance=ExtResource("7_7rpe6")] +value = 10 + +[node name="RandomValue" type="Node" parent="Valuable"] +script = ExtResource("8_utkrs") + +[node name="SoundWorking" type="AudioStreamPlayer" parent="."] +stream = ExtResource("9_6xmfi") + +[connection signal="collected" from="Collectible" to="Collectible" method="_on_done" flags=18] diff --git a/entity/item_crown_gems.png b/entity/item/item_crown_gems.png similarity index 100% rename from entity/item_crown_gems.png rename to entity/item/item_crown_gems.png diff --git a/entity/item_crown_gems.png.import b/entity/item/item_crown_gems.png.import similarity index 70% rename from entity/item_crown_gems.png.import rename to entity/item/item_crown_gems.png.import index 4e8af5f..013fe60 100644 --- a/entity/item_crown_gems.png.import +++ b/entity/item/item_crown_gems.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://l7kr24oe0fc8" -path="res://.godot/imported/item_crown_gems.png-57e99547b8bc3470cb75cd17193c0abd.ctex" +path="res://.godot/imported/item_crown_gems.png-20cb9b6c45e833bf6f0cfe53ff4bfe74.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/item_crown_gems.png" -dest_files=["res://.godot/imported/item_crown_gems.png-57e99547b8bc3470cb75cd17193c0abd.ctex"] +source_file="res://entity/item/item_crown_gems.png" +dest_files=["res://.godot/imported/item_crown_gems.png-20cb9b6c45e833bf6f0cfe53ff4bfe74.ctex"] [params] diff --git a/entity/item_ring.png b/entity/item/item_ring.png similarity index 100% rename from entity/item_ring.png rename to entity/item/item_ring.png diff --git a/entity/item_ring.png.import b/entity/item/item_ring.png.import similarity index 72% rename from entity/item_ring.png.import rename to entity/item/item_ring.png.import index 7b32cbf..ed312a0 100644 --- a/entity/item_ring.png.import +++ b/entity/item/item_ring.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dcw3cq3ni253t" -path="res://.godot/imported/item_ring.png-a4f5983b41259568642782622b1a92ac.ctex" +path="res://.godot/imported/item_ring.png-11e67ad2864164079ba081a171645596.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/item_ring.png" -dest_files=["res://.godot/imported/item_ring.png-a4f5983b41259568642782622b1a92ac.ctex"] +source_file="res://entity/item/item_ring.png" +dest_files=["res://.godot/imported/item_ring.png-11e67ad2864164079ba081a171645596.ctex"] [params] diff --git a/entity/item/item_ring.tscn b/entity/item/item_ring.tscn new file mode 100644 index 0000000..5a199ce --- /dev/null +++ b/entity/item/item_ring.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=11 format=3 uid="uid://y2p6j177k3nr"] + +[ext_resource type="PhysicsMaterial" uid="uid://c6kn1an85lccr" path="res://entity/coin_physics_material.tres" id="1_yyeot"] +[ext_resource type="Texture2D" uid="uid://dcw3cq3ni253t" path="res://entity/item/item_ring.png" id="2_kevks"] +[ext_resource type="Texture2D" uid="uid://dnfkvj0usdb6n" path="res://entity/item/item_ring_gems.png" id="3_foriv"] +[ext_resource type="PackedScene" uid="uid://vkvtap437nnf" path="res://color/colored.tscn" id="4_dscrk"] +[ext_resource type="Shader" path="res://entity/gem/gem_shading_material.gdshader" id="5_pu8lc"] +[ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="6_lont5"] +[ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="7_37tvl"] +[ext_resource type="Script" path="res://entity/gem/RandomValue.gd" id="8_ddhh8"] +[ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="9_0enei"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ka4h2"] +radius = 5.64 +height = 17.01 + +[node name="ItemRing" type="RigidBody2D"] +collision_layer = 5 +collision_mask = 7 +mass = 1.5 +inertia = 800.0 +physics_material_override = ExtResource("1_yyeot") +continuous_cd = 1 +linear_damp = 0.1 +angular_damp = 0.1 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +scale = Vector2(4, 4) +shape = SubResource("CapsuleShape2D_ka4h2") + +[node name="Sprite2D" type="Sprite2D" parent="CollisionShape2D"] +texture_filter = 1 +texture = ExtResource("2_kevks") + +[node name="Sprite" type="Sprite2D" parent="CollisionShape2D"] +texture_filter = 1 +texture = ExtResource("3_foriv") + +[node name="Colored" parent="CollisionShape2D/Sprite" instance=ExtResource("4_dscrk")] +shader = ExtResource("5_pu8lc") + +[node name="Collectible" parent="." instance=ExtResource("6_lont5")] +type = &"Gem" + +[node name="Valuable" parent="." instance=ExtResource("7_37tvl")] +value = 10 + +[node name="RandomValue" type="Node" parent="Valuable"] +script = ExtResource("8_ddhh8") + +[node name="SoundWorking" type="AudioStreamPlayer" parent="."] +stream = ExtResource("9_0enei") + +[connection signal="collected" from="Collectible" to="Collectible" method="_on_done" flags=18] diff --git a/entity/item_ring_gems.png b/entity/item/item_ring_gems.png similarity index 100% rename from entity/item_ring_gems.png rename to entity/item/item_ring_gems.png diff --git a/entity/item_ring_gems.png.import b/entity/item/item_ring_gems.png.import similarity index 70% rename from entity/item_ring_gems.png.import rename to entity/item/item_ring_gems.png.import index 148080e..3369f28 100644 --- a/entity/item_ring_gems.png.import +++ b/entity/item/item_ring_gems.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dnfkvj0usdb6n" -path="res://.godot/imported/item_ring_gems.png-15fb2caf015b721a6fe6cd5c86878289.ctex" +path="res://.godot/imported/item_ring_gems.png-83a22b3deeb0b23cf11f84fd34725cf7.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://entity/item_ring_gems.png" -dest_files=["res://.godot/imported/item_ring_gems.png-15fb2caf015b721a6fe6cd5c86878289.ctex"] +source_file="res://entity/item/item_ring_gems.png" +dest_files=["res://.godot/imported/item_ring_gems.png-83a22b3deeb0b23cf11f84fd34725cf7.ctex"] [params] diff --git a/export_presets.cfg b/export_presets.cfg index 20ed2b4..47d0550 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -28,7 +28,7 @@ architectures/x86=false architectures/x86_64=false version/code=1 version/name="1.0" -package/unique_name="org.godotengine.$genname" +package/unique_name="eu.steffo.ld54" package/name="" package/signed=true package/app_category=2 diff --git a/game/game.gd b/game/game.gd index 50144c4..d2fc53d 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,7 @@ func _on_purchase_begin(what: PurchasableItem): update_counter_icon() update_counter_text() store_collector_panel.show() + time_spawner_timer.stop() func _handle_purchase_success(what: PurchasableItem): what.complete_purchase() @@ -47,12 +49,18 @@ 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() + time_spawner_timer.start() 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() + time_spawner_timer.start() func _on_store_collector_collected(_body: RigidBody2D): update_counter_text() @@ -75,3 +83,12 @@ func update_counter_icon(): store_collector_texturerect.texture = upgrade_gold_texture else: store_collector_texturerect.texture = null + +func _on_ghost_requested(scene: PackedScene, texture: Texture2D): + ghost.scene_to_instantiate = scene + ghost.preview_texture = texture + ghost.process_mode = Node.PROCESS_MODE_INHERIT + ghost.show() + +func _on_ghost_materialize(): + ghost.materialize() diff --git a/game/game.tscn b/game/game.tscn index 05c4bbe..4c746f2 100644 --- a/game/game.tscn +++ b/game/game.tscn @@ -5,25 +5,24 @@ [ext_resource type="PackedScene" uid="uid://d05b8jy3xmpcb" path="res://bottle/gravity_from_gyro.tscn" id="2_h2pfr"] [ext_resource type="Texture2D" uid="uid://7b12rwclhrq0" path="res://interface/upgrade_silver.png" id="3_8wvr1"] [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/coin_copper.tscn" id="4_5oayc"] [ext_resource type="Texture2D" uid="uid://taojrwr7xrp4" path="res://interface/upgrade_gold.png" id="4_i557v"] +[ext_resource type="Texture2D" uid="uid://pj3ip6vlatms" path="res://converters/copper_to_silver/copper_converter.png" id="6_0jj8g"] [ext_resource type="PackedScene" uid="uid://beg758fa6o0cs" path="res://value/evaluator.tscn" id="6_my6nv"] -[ext_resource type="PackedScene" uid="uid://du3005kwybbrh" path="res://entity/coin_gold/coin_gold.tscn" id="7_hh80i"] [ext_resource type="PackedScene" uid="uid://ratkps4plkhl" path="res://converters/copper_to_silver/copper_converter.tscn" id="7_ipeok"] -[ext_resource type="PackedScene" uid="uid://but1bdslxp5jl" path="res://converters/silver_to_gold/silver_converter.tscn" id="8_0bbpi"] -[ext_resource type="PackedScene" uid="uid://bawprh8kluilq" path="res://entity/gem/gem.tscn" id="8_a3sk0"] +[ext_resource type="PackedScene" uid="uid://4d0al27t7axe" path="res://bottle/placeable_area.tscn" id="7_muqgj"] [ext_resource type="PackedScene" uid="uid://c2rlx7egl7xiv" path="res://collector/universal_collector.tscn" id="9_7op48"] [ext_resource type="PackedScene" uid="uid://c5w3b55aiui6c" path="res://collector/collector.tscn" id="9_evdhb"] [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="PackedScene" uid="uid://qtk4tm6l367w" path="res://interface/ghost.tscn" id="16_8vhx6"] -[sub_resource type="RectangleShape2D" id="RectangleShape2D_4uksi"] -size = Vector2(80, 80) - [sub_resource type="RectangleShape2D" id="RectangleShape2D_rh35r"] size = Vector2(240, 384) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_4uksi"] +size = Vector2(80, 80) + [sub_resource type="RectangleShape2D" id="RectangleShape2D_i50bq"] size = Vector2(540, 135) @@ -40,20 +39,36 @@ upgrade_copper_texture = ExtResource("11_lt33g") upgrade_silver_texture = ExtResource("3_8wvr1") upgrade_gold_texture = ExtResource("4_i557v") -[node name="Ghost" parent="." instance=ExtResource("16_8vhx6")] -position = Vector2(90, 306) -collision_layer = 8 -collision_mask = 6 +[node name="GravityFromGyro" parent="." instance=ExtResource("2_h2pfr")] + +[node name="Ghost" parent="." node_paths=PackedStringArray("target") instance=ExtResource("16_8vhx6")] +process_mode = 4 +visible = false +position = Vector2(135, 360) +preview_texture = ExtResource("6_0jj8g") +scene_to_instantiate = ExtResource("7_ipeok") +target = NodePath("..") +metadata/_edit_lock_ = true [node name="Bottle" parent="." instance=ExtResource("1_y7o2l")] +metadata/_edit_lock_ = true + +[node name="PlaceableArea" parent="Bottle" instance=ExtResource("7_muqgj")] + +[node name="Evaluator" parent="Bottle" instance=ExtResource("6_my6nv")] +position = Vector2(136, 272) + +[node name="BottleShape" type="CollisionShape2D" parent="Bottle/Evaluator"] +shape = SubResource("RectangleShape2D_rh35r") +debug_color = Color(0, 0.6, 0.701961, 0) [node name="TimeSpawner" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_qwsty")] position = Vector2(136, 0) -scene = ExtResource("8_a3sk0") target = NodePath("..") buffer_cap = 1 spawn_rect = Rect2(-20, 0, 40, 0) overlapping_body_count_limit = 4 +metadata/_edit_lock_ = true [node name="NeckShape" type="CollisionShape2D" parent="TimeSpawner"] position = Vector2(0, 40) @@ -61,50 +76,24 @@ shape = SubResource("RectangleShape2D_4uksi") debug_color = Color(0, 0.6, 0.701961, 0) [node name="Timer" type="Timer" parent="TimeSpawner"] -wait_time = 0.1 -autostart = true [node name="ButtonSpawner" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_qwsty")] position = Vector2(136, 0) -scene = ExtResource("4_5oayc") +scene = ExtResource("13_4j8om") target = NodePath("..") buffer_cap = 10 spawn_rect = Rect2(-20, 0, 40, 0) overlapping_body_count_limit = 4 +metadata/_edit_lock_ = true [node name="NeckShape" type="CollisionShape2D" parent="ButtonSpawner"] position = Vector2(0, 40) shape = SubResource("RectangleShape2D_4uksi") debug_color = Color(0, 0.6, 0.701961, 0) -[node name="GravityFromGyro" parent="." instance=ExtResource("2_h2pfr")] - -[node name="Evaluator" parent="." instance=ExtResource("6_my6nv")] -position = Vector2(136, 272) - -[node name="BottleShape" type="CollisionShape2D" parent="Evaluator"] -shape = SubResource("RectangleShape2D_rh35r") -debug_color = Color(0, 0.6, 0.701961, 0) - -[node name="CopperConverter" parent="." instance=ExtResource("7_ipeok")] -position = Vector2(62, 176) -metadata/_edit_group_ = true - -[node name="Spawner" parent="CopperConverter" index="6" node_paths=PackedStringArray("target")] -target = NodePath("../..") - -[node name="PreventSpawnShape" parent="CopperConverter/Spawner" index="0"] -position = Vector2(0, 4.08333) - -[node name="SilverConverter" parent="." instance=ExtResource("8_0bbpi")] -position = Vector2(205, 337) -rotation = -3.14159 - -[node name="Spawner" parent="SilverConverter" index="6" node_paths=PackedStringArray("target")] -target = NodePath("../..") - [node name="StoreCollector" parent="." instance=ExtResource("9_evdhb")] position = Vector2(135, 0) +metadata/_edit_lock_ = true [node name="CollisionShape2D" type="CollisionShape2D" parent="StoreCollector"] position = Vector2(0, -67) @@ -160,6 +149,7 @@ vertical_alignment = 1 [node name="UniversalCollectorTop" parent="." instance=ExtResource("9_7op48")] position = Vector2(135, -270) +metadata/_edit_lock_ = true [node name="ShapeTop" type="CollisionShape2D" parent="UniversalCollectorTop"] shape = SubResource("RectangleShape2D_auxq0") @@ -180,9 +170,6 @@ position = Vector2(405, 540) shape = SubResource("RectangleShape2D_jed57") 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="changed" from="Evaluator" to="." method="_on_score_changed"] [connection signal="collected" from="StoreCollector" to="." method="_on_store_collector_collected"] - -[editable path="CopperConverter"] -[editable path="SilverConverter"] diff --git a/interface/ghost.gd b/interface/ghost.gd index 36e5ca6..d338bdc 100644 --- a/interface/ghost.gd +++ b/interface/ghost.gd @@ -1,25 +1,107 @@ extends Area2D class_name Ghost -var is_dragging: bool -var previous_position: Vector2 +## Ghost previewing the instantiation of a scene. + +## The [CollisionShape2D] to use to check for placement checks. +## +## MUST consist of a [RectangleShape2D]. +@onready var placement_shape: CollisionShape2D = $PlacementShape + +## The [Sprite2D] node previewing the scene. +@onready var preview_sprite: Sprite2D = $PlacementShape/PreviewSprite + +## The collision mask of objects that should prevent this object's placement. +@export_flags_2d_physics var collision_mask_prevent_placement: int + +## The collision mask of objects that should be deleted on this object's placement. +@export_flags_2d_physics var collision_mask_delete_placement: int + +## The texture that the preview sprite should display. +@export var preview_texture: Texture2D: + get: + return preview_texture + set(value): + preview_texture = value + # Quick priority fix + if preview_sprite: + preview_sprite.texture = value + +## Whether the ghost can be placed at the current location of the ghost. +## +## Computed by checking if [placement_shape] overlaps any entity and is inside the [PlacementArea] of the [Bottle]. +var can_place: bool: + get: + return can_place + set(value): + if value: + preview_sprite.modulate = Color(1.0, 1.0, 1.0, 0.5) + else: + preview_sprite.modulate = Color(1.0, 0.0, 0.0, 0.5) + +## The last input event of the input that's dragging the ghost around, or null if the ghost isn't being dragged. +var last_input_event: InputEvent + + +func _ready(): + collision_mask = collision_mask_prevent_placement | collision_mask_delete_placement + preview_sprite.texture = preview_texture + func _input(event: InputEvent): + # Handle mouse click if event is InputEventMouseButton: - is_dragging = event.pressed - previous_position = event.position + last_input_event = event if event.pressed else null + # Handle touch begin elif event is InputEventScreenTouch: - is_dragging = event.pressed - previous_position = event.position + last_input_event = event if event.pressed else null - if is_dragging: - if event is InputEventMouseMotion: - var delta = event.position - previous_position - print(delta) + # If is dragging + if last_input_event: + # Handle mouse drag + if last_input_event is InputEventMouse and event is InputEventMouse: + var delta = event.position - last_input_event.position position += delta - previous_position = event.position - elif event is InputEventScreenDrag: - var delta = event.position - previous_position - print(delta) - position += delta - previous_position = event.position + last_input_event = event + # Handle touch drag + elif (last_input_event is InputEventScreenTouch or last_input_event is InputEventScreenDrag) and event is InputEventScreenDrag: + if event.index == last_input_event.index: + var delta = event.position - last_input_event.position + position += delta + last_input_event = event + +# DIRTY HACK: Relies on the placeable area being perfectly surrounded by solid bodies. +func _physics_process(_delta: float): + var no_overlapping_bodies: bool = true + var overlapping_bodies = get_overlapping_bodies() + for body in overlapping_bodies: + if body is TileMap: + no_overlapping_bodies = false + elif body is PhysicsBody2D: + var body_prevents_placement = bool(body.collision_layer & collision_mask_prevent_placement) + no_overlapping_bodies = no_overlapping_bodies and not body_prevents_placement + + var is_in_placeable_area: bool = false + var overlapping_areas = get_overlapping_areas() + for area in overlapping_areas: + if area is PlaceableArea: + is_in_placeable_area = true + + can_place = no_overlapping_bodies and is_in_placeable_area + + +## The [PackedScene] that this node should instantiate. +@export var scene_to_instantiate: PackedScene + +## The [Node] instatiated scenes should be added as children to. +@export var target: Node + +## Emitted when the [materialize] function has finished executing. +signal materialized(node: Node) + +func materialize(): + var instantiated = scene_to_instantiate.instantiate() + instantiated.global_position = global_position + instantiated.rotation = rotation + target.add_child(instantiated) + materialized.emit(instantiated) diff --git a/interface/ghost.tscn b/interface/ghost.tscn index cbf9850..f3edebd 100644 --- a/interface/ghost.tscn +++ b/interface/ghost.tscn @@ -1,20 +1,19 @@ -[gd_scene load_steps=4 format=3 uid="uid://qtk4tm6l367w"] +[gd_scene load_steps=3 format=3 uid="uid://qtk4tm6l367w"] [ext_resource type="Script" path="res://interface/ghost.gd" id="1_gvls7"] -[ext_resource type="Texture2D" uid="uid://pj3ip6vlatms" path="res://converters/copper_to_silver/copper_converter.png" id="1_lo8gj"] - -[sub_resource type="RectangleShape2D" id="RectangleShape2D_hmopu"] -size = Vector2(34, 34) +[ext_resource type="PackedScene" uid="uid://c3p0jdf7416ac" path="res://converters/full_converter_shape.tscn" id="3_lskcf"] [node name="Ghost" type="Area2D"] -scale = Vector2(3, 3) +collision_layer = 0 +collision_mask = 4294967295 input_pickable = false script = ExtResource("1_gvls7") +collision_mask_prevent_placement = 16 +collision_mask_delete_placement = 4 -[node name="Sprite" type="Sprite2D" parent="."] -modulate = Color(1, 1, 1, 0.470588) +[node name="PlacementShape" parent="." instance=ExtResource("3_lskcf")] +scale = Vector2(3, 3) + +[node name="PreviewSprite" type="Sprite2D" parent="PlacementShape"] +modulate = Color(1, 1, 1, 0.5) z_index = 10 -texture = ExtResource("1_lo8gj") - -[node name="Shape" type="CollisionShape2D" parent="."] -shape = SubResource("RectangleShape2D_hmopu") diff --git a/interface/interface_theme.tres b/interface/interface_theme.tres index 20b8426..2290aa9 100644 --- a/interface/interface_theme.tres +++ b/interface/interface_theme.tres @@ -3,7 +3,7 @@ [ext_resource type="FontFile" uid="uid://cs8tiwyb76gig" path="res://interface/font/press-start/prstart.ttf" id="1_mtdor"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_knce4"] -bg_color = Color(0.0901961, 0.227451, 0.290196, 0.929412) +bg_color = Color(0.0901961, 0.227451, 0.290196, 0.686275) border_width_left = 2 border_width_top = 2 border_width_right = 2 diff --git a/interface/purchasable_item.gd b/interface/purchasable_item.gd index e43c5ad..ac10bd2 100644 --- a/interface/purchasable_item.gd +++ b/interface/purchasable_item.gd @@ -33,6 +33,9 @@ class_name PurchasableItem item_cost_text = value $Contents/Action/CostLabel.text = value +## If this is a converter, the scene to instantiate. +@export var item_scene: PackedScene + ## Collectible type of the item required to buy the item. @export var item_cost_type: StringName diff --git a/interface/purchasable_item.tscn b/interface/purchasable_item.tscn index a1a7722..6bfe3fe 100644 --- a/interface/purchasable_item.tscn +++ b/interface/purchasable_item.tscn @@ -5,7 +5,7 @@ [ext_resource type="Theme" uid="uid://ba5utvfhnxa5i" path="res://interface/interface_theme.tres" id="1_r2qbu"] [node name="PurchasableItem" type="Panel"] -custom_minimum_size = Vector2(0, 240) +custom_minimum_size = Vector2(0, 150) anchors_preset = 10 anchor_right = 1.0 grow_horizontal = 2 @@ -52,6 +52,8 @@ layout_mode = 2 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 16 text = "ITEMNAME" +vertical_alignment = 1 +autowrap_mode = 2 uppercase = true [node name="NamePaddingRight" type="Control" parent="Contents/Header"] @@ -78,7 +80,7 @@ mouse_filter = 1 layout_mode = 2 size_flags_horizontal = 3 mouse_filter = 1 -theme_override_font_sizes/font_size = 16 +theme_override_font_sizes/font_size = 8 text = "What does this item do? Nobody knows." autowrap_mode = 2 @@ -115,7 +117,7 @@ mouse_filter = 1 layout_mode = 2 size_flags_horizontal = 10 mouse_filter = 1 -theme_override_font_sizes/font_size = 16 +theme_override_font_sizes/font_size = 8 text = "3 fiorygi" horizontal_alignment = 2 vertical_alignment = 1 diff --git a/interface/purchasable_item_padding.tscn b/interface/purchasable_item_padding.tscn index ce48e84..95097c5 100644 --- a/interface/purchasable_item_padding.tscn +++ b/interface/purchasable_item_padding.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://wodgj6rp2ewm"] [node name="PurchasableItemPadding" type="Control"] -custom_minimum_size = Vector2(0, 8) +custom_minimum_size = Vector2(0, 2) layout_mode = 3 anchors_preset = 0 mouse_filter = 1 diff --git a/interface/score_button.gd b/interface/score_button.gd index 2331bf2..a4b4eb5 100644 --- a/interface/score_button.gd +++ b/interface/score_button.gd @@ -3,4 +3,6 @@ class_name ScoreButton func set_score(total: int): + if total >= 1000: + add_theme_font_size_override("font_size", 8) text = "$%0.2f" % (float(total) / 100) diff --git a/interface/score_button.tscn b/interface/score_button.tscn index 8774234..0946460 100644 --- a/interface/score_button.tscn +++ b/interface/score_button.tscn @@ -7,6 +7,7 @@ custom_minimum_size = Vector2(72, 0) offset_right = 72.0 offset_bottom = 54.0 size_flags_horizontal = 0 +theme_override_font_sizes/font_size = 16 text = "$0.00" alignment = 0 script = ExtResource("1_ol56t") diff --git a/interface/shop_ui.gd b/interface/shop_ui.gd index 57aaf7a..33d6e0b 100644 --- a/interface/shop_ui.gd +++ b/interface/shop_ui.gd @@ -26,6 +26,8 @@ signal purchase_success(what: PurchasableItem) ## Array of all PurchasableItems that this ShopUI should control. @onready var purchasable_items: Array[Node] = find_children("*", "PurchasableItem") +signal ghost_requested(scene: PackedScene, texture: Texture2D) + func _ready(): for item in purchasable_items: @@ -37,6 +39,8 @@ func _on_any_purchase_begin(what: Node): if not what is PurchasableItem: push_error("Purchase began outside a PurchasableItem") return + if what.item_scene: + ghost_requested.emit(what.item_scene, what.item_icon) purchase_begin.emit(what) for item in purchasable_items: if item == what: @@ -57,6 +61,8 @@ func _on_any_purchase_success(what: Node): if not what is PurchasableItem: push_error("Purchase succeeded outside a PurchasableItem") return + if what.item_scene: + ghost_materialize.emit() purchase_success.emit(what) for item in purchasable_items: if item == what: @@ -122,3 +128,26 @@ func _on_buy_silver_star_purchase_success(): func _on_buy_gold_star_purchase_success(): print("[ShopUI] Upgrading to Manual Gold...") upgraded_manual_spawn.emit(gold_coin_scene) + + +signal ghost_materialize + +func _on_buy_silverifier_purchase_success(): + print("[ShopUI] Completing Silver-ifier...") + $Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory/BuyGoldenser.has_unlocked = true + +func _on_buy_goldenser_purchase_success(): + print("[ShopUI] Completing Gold-enser...") + $Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory/BuyGemificator.has_unlocked = true + $Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory/BuyCompressor.has_unlocked = true + +func _on_buy_gemificator_purchase_begin(): + print("[ShopUI] Completing Gem-ificator...") + $Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory/BuyArtifactomatic.has_unlocked = true + +func _on_buy_compressor_purchase_success(): + print("[ShopUI] Completing Coal-pressor...") + $Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory/BuyArtifactomatic.has_unlocked = true + +func _on_buy_artifactomatic_purchase_success(): + print("[ShopUI] Completing Arti-factory...") diff --git a/interface/shop_ui.tscn b/interface/shop_ui.tscn index e41a905..204847b 100644 --- a/interface/shop_ui.tscn +++ b/interface/shop_ui.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=3 uid="uid://cklkdygv61bny"] +[gd_scene load_steps=20 format=3 uid="uid://cklkdygv61bny"] [ext_resource type="Theme" uid="uid://ba5utvfhnxa5i" path="res://interface/interface_theme.tres" id="1_qdf0y"] [ext_resource type="PackedScene" uid="uid://dul1fpyh733t7" path="res://interface/purchasable_item.tscn" id="2_2dtc0"] @@ -13,6 +13,12 @@ [ext_resource type="Texture2D" uid="uid://c8pvjgtr2ufjl" path="res://interface/upgrade_copper.png" id="8_270dw"] [ext_resource type="Texture2D" uid="uid://7b12rwclhrq0" path="res://interface/upgrade_silver.png" id="8_caq4i"] [ext_resource type="Texture2D" uid="uid://taojrwr7xrp4" path="res://interface/upgrade_gold.png" id="9_amnej"] +[ext_resource type="PackedScene" uid="uid://ratkps4plkhl" path="res://converters/copper_to_silver/copper_converter.tscn" id="10_dui5v"] +[ext_resource type="PackedScene" uid="uid://but1bdslxp5jl" path="res://converters/silver_to_gold/silver_converter.tscn" id="12_ml4jm"] +[ext_resource type="Texture2D" uid="uid://dsqe2oovfkwbv" path="res://converters/gold_to_gem/gold_converter.png" id="13_gsd84"] +[ext_resource type="PackedScene" uid="uid://cb1t7ylnkmt3t" path="res://converters/gold_to_gem/gold_converter.tscn" id="13_m0kio"] +[ext_resource type="Texture2D" uid="uid://bktdm8yu8tdfn" path="res://converters/item_converter/item_converter.png" id="14_1p6uj"] +[ext_resource type="PackedScene" uid="uid://ddrhfhebwtq5" path="res://converters/item_converter/item_converter.tscn" id="14_tgckt"] [node name="ShopUI" type="Panel"] anchors_preset = 15 @@ -34,30 +40,36 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="UpperButtons" type="HBoxContainer" parent="Rows"] +[node name="UpperButtons" type="Control" parent="Rows"] custom_minimum_size = Vector2(0, 54) layout_mode = 2 [node name="ScoreButton" parent="Rows/UpperButtons" instance=ExtResource("3_7vro3")] -layout_mode = 2 - -[node name="UpperButtonsSpacerLeft" type="Control" parent="Rows/UpperButtons"] -layout_mode = 2 -size_flags_horizontal = 3 +custom_minimum_size = Vector2(88, 0) +layout_mode = 0 [node name="DeleteButton" type="Button" parent="Rows/UpperButtons"] -custom_minimum_size = Vector2(72, 0) -layout_mode = 2 +custom_minimum_size = Vector2(88, 0) +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -36.0 +offset_right = 36.0 +offset_bottom = 54.0 +grow_horizontal = 2 size_flags_horizontal = 4 text = "Del" -[node name="UpperButtonsSpacerRight" type="Control" parent="Rows/UpperButtons"] -layout_mode = 2 -size_flags_horizontal = 3 - [node name="BackButton" type="Button" parent="Rows/UpperButtons"] -custom_minimum_size = Vector2(72, 0) -layout_mode = 2 +custom_minimum_size = Vector2(88, 0) +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -72.0 +offset_bottom = 54.0 +grow_horizontal = 0 size_flags_horizontal = 8 text = "Back" alignment = 2 @@ -68,7 +80,7 @@ layout_mode = 2 size_flags_vertical = 3 [node name="PaddedScrollableLeft" type="Control" parent="Rows/PaddedScrollable"] -custom_minimum_size = Vector2(8, 0) +custom_minimum_size = Vector2(2, 0) layout_mode = 2 size_flags_horizontal = 0 @@ -106,9 +118,10 @@ layout_mode = 2 [node name="BuySilverifier" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_icon = ExtResource("5_lu2tr") -item_name = "Silverifier" +item_name = "Silver-ifier" item_description = "Exchanges ten copper coins for a shiny silver coin!" item_cost_text = "35 copper" +item_scene = ExtResource("10_dui5v") item_cost_type = &"Copper" item_cost_goal = 35 @@ -118,9 +131,10 @@ layout_mode = 2 [node name="BuyGoldenser" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_icon = ExtResource("6_70u64") -item_name = "Goldenser" +item_name = "Gold-enser" item_description = "Trades in ten silver coins for a sparkly gold coin!" item_cost_text = "??" +item_scene = ExtResource("12_ml4jm") has_unlocked = false [node name="PurchasableItemPadding2" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] @@ -128,9 +142,11 @@ layout_mode = 2 [node name="BuyGemificator" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 -item_name = "Gemificator" +item_icon = ExtResource("13_gsd84") +item_name = "Gem-ificator" item_description = "Converts ten gold coins into a randomly colored gem!" item_cost_text = "??" +item_scene = ExtResource("13_m0kio") has_unlocked = false [node name="PurchasableItemPadding4" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] @@ -138,7 +154,7 @@ layout_mode = 2 [node name="BuyCompressor" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 -item_name = "Compressor" +item_name = "Coal-pressor" item_description = "Consumes ten gold coins to create either a precious white diamond or an useless lump of coal!" item_cost_text = "??" has_unlocked = false @@ -148,9 +164,11 @@ layout_mode = 2 [node name="BuyArtifactomatic" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 -item_name = "Artifactic" +item_icon = ExtResource("14_1p6uj") +item_name = "Arti-factory" item_description = "Assembles an artifact from twenty-five gold coins and a gem or a diamond!" item_cost_text = "??" +item_scene = ExtResource("14_tgckt") has_unlocked = false [node name="PurchasableItemPadding7" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] @@ -292,13 +310,18 @@ one_shot = true layout_mode = 2 [node name="PaddedScrollableRight" type="Control" parent="Rows/PaddedScrollable"] -custom_minimum_size = Vector2(8, 0) +custom_minimum_size = Vector2(2, 0) layout_mode = 2 size_flags_horizontal = 8 [connection signal="pressed" from="Rows/UpperButtons/ScoreButton" to="." method="_on_score_button_pressed"] [connection signal="pressed" from="Rows/UpperButtons/DeleteButton" to="." method="_on_delete_button_pressed"] [connection signal="pressed" from="Rows/UpperButtons/BackButton" to="." method="_on_back_button_pressed"] +[connection signal="purchase_success" from="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory/BuySilverifier" to="." method="_on_buy_silverifier_purchase_success"] +[connection signal="purchase_success" from="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory/BuyGoldenser" to="." method="_on_buy_goldenser_purchase_success"] +[connection signal="purchase_begin" from="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory/BuyGemificator" to="." method="_on_buy_gemificator_purchase_begin"] +[connection signal="purchase_success" from="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory/BuyCompressor" to="." method="_on_buy_compressor_purchase_success"] +[connection signal="purchase_success" from="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory/BuyArtifactomatic" to="." method="_on_buy_artifactomatic_purchase_success"] [connection signal="purchase_success" from="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyAutoCopper" to="." method="_on_buy_auto_copper_purchase_success"] [connection signal="purchase_success" from="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyHeliCopper" to="." method="_on_buy_heli_copper_purchase_success"] [connection signal="purchase_success" from="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyAutoSilver" to="." method="_on_buy_auto_silver_purchase_success"] diff --git a/main.tscn b/main.tscn index 2319e5f..214fc37 100644 --- a/main.tscn +++ b/main.tscn @@ -36,7 +36,6 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -mouse_default_cursor_shape = 5 stretch = true [node name="Viewport" type="SubViewport" parent="CustomUI/GameViewport"] @@ -78,11 +77,14 @@ apply_margin_bottom = true layout_mode = 2 [connection signal="score_changed" from="CustomUI/GameViewport/Viewport/Game" to="CustomUI/GameSafeUI/GameUI" method="_on_game_score_changed"] +[connection signal="score_changed" from="CustomUI/GameViewport/Viewport/Game" to="CustomUI/ShopSafeUI/ShopUI" method="_on_game_score_changed"] [connection signal="score_button_pressed" from="CustomUI/GameSafeUI/GameUI" to="." method="_on_game_ui_score_button_pressed"] [connection signal="shop_button_pressed" from="CustomUI/GameSafeUI/GameUI" to="." method="_on_game_ui_shop_button_pressed"] [connection signal="spawn_button_pressed" from="CustomUI/GameSafeUI/GameUI" to="CustomUI/GameViewport/Viewport/Game" method="trigger_spawn"] [connection signal="back_button_pressed" from="CustomUI/ShopSafeUI/ShopUI" to="." method="_on_shop_ui_back_button_pressed"] [connection signal="delete_button_pressed" from="CustomUI/ShopSafeUI/ShopUI" to="." method="_on_shop_ui_delete_button_pressed"] +[connection signal="ghost_materialize" from="CustomUI/ShopSafeUI/ShopUI" to="CustomUI/GameViewport/Viewport/Game" method="_on_ghost_materialize"] +[connection signal="ghost_requested" from="CustomUI/ShopSafeUI/ShopUI" to="CustomUI/GameViewport/Viewport/Game" method="_on_ghost_requested"] [connection signal="purchase_begin" from="CustomUI/ShopSafeUI/ShopUI" to="." method="_on_shop_ui_purchase_begin"] [connection signal="purchase_begin" from="CustomUI/ShopSafeUI/ShopUI" to="CustomUI/GameViewport/Viewport/Game" method="_on_purchase_begin"] [connection signal="purchase_cancel" from="CustomUI/ShopSafeUI/ShopUI" to="CustomUI/GameViewport/Viewport/Game" method="_on_purchase_cancel"] diff --git a/project.godot b/project.godot index 5fdf41d..dfc98a5 100644 --- a/project.godot +++ b/project.godot @@ -10,7 +10,7 @@ config_version=5 [application] -config/name="ld54" +config/name="Swear Jar" run/main_scene="res://main.tscn" config/features=PackedStringArray("4.1", "Mobile") boot_splash/bg_color=Color(0.0977035, 0.0977035, 0.10161, 1) @@ -30,7 +30,8 @@ window/handheld/orientation=1 2d_physics/layer_1="Default" 2d_physics/layer_2="Bottle" 2d_physics/layer_3="Entities" -2d_physics/layer_4="Ghost" +2d_physics/layer_4="Converter" +2d_physics/layer_5="Placement" [physics] diff --git a/root.tscn b/root.tscn deleted file mode 100644 index 626e722..0000000 --- a/root.tscn +++ /dev/null @@ -1,41 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://cbccs6kwwf265"] - -[ext_resource type="Script" path="res://main.gd" id="1_ncl4v"] -[ext_resource type="PackedScene" uid="uid://c3rxmcwa5nqng" path="res://game/game.tscn" id="3_hrdyr"] -[ext_resource type="PackedScene" uid="uid://bo5unrhqpoyim" path="res://interface/game_ui.tscn" id="5_2cc15"] - -[node name="Root" type="Node"] -script = ExtResource("1_ncl4v") - -[node name="View@CenterUI" type="CenterContainer" parent="."] -anchors_preset = 7 -anchor_left = 0.5 -anchor_top = 1.0 -anchor_right = 0.5 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="View@CenterUI@ViewportContainer" type="SubViewportContainer" parent="."] -custom_minimum_size = Vector2(270, 480) -stretch = true - -[node name="View@CenterUI@ViewportContainer@Viewport" type="SubViewport" parent="."] -handle_input_locally = false -size = Vector2i(270, 480) -render_target_update_mode = 4 - -[node name="View@CenterUI@ViewportContainer@Viewport@Game" parent="." instance=ExtResource("3_hrdyr")] - -[node name="View@CenterUI@ViewportContainer@Viewport@Camera2D" type="Camera2D" parent="."] -anchor_mode = 0 - -[node name="View@SafeUI" type="MarginContainer" parent="."] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="View@SafeUI@GameUI" parent="." instance=ExtResource("5_2cc15")] -process_mode = 3 diff --git a/spawner/spawner.gd b/spawner/spawner.gd index e7c8ba2..08aba7a 100644 --- a/spawner/spawner.gd +++ b/spawner/spawner.gd @@ -49,7 +49,10 @@ 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 + if scene == null: 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") diff --git a/value/evaluator.tscn b/value/evaluator.tscn index e797c93..8474048 100644 --- a/value/evaluator.tscn +++ b/value/evaluator.tscn @@ -3,6 +3,8 @@ [ext_resource type="Script" path="res://value/evaluator.gd" id="1_sjx78"] [node name="Evaluator" type="Area2D"] +collision_layer = 0 +collision_mask = 4 script = ExtResource("1_sjx78") [connection signal="body_entered" from="." to="." method="_on_body_entered"]