From 307f41695168c0c86fe0d0799dccba807ac678fd Mon Sep 17 00:00:00 2001 From: Matteo Balugani Date: Mon, 2 Oct 2023 21:29:05 +0200 Subject: [PATCH] pericolo --- .../copper_to_silver/copper_converter.tscn | 1 + .../coal_diamond_converter.tscn | 12 +++++-- entity/coal.png.import | 34 +++++++++++++++++++ entity/coin_copper/coin_copper.tscn | 5 ++- entity/coin_gold/coin_gold.tscn | 2 +- game/game.tscn | 16 +++++++-- main.tscn | 2 +- spawner/spawner.gd | 4 +++ 8 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 entity/coal.png.import diff --git a/converters/copper_to_silver/copper_converter.tscn b/converters/copper_to_silver/copper_converter.tscn index fc9aeff..a41706e 100644 --- a/converters/copper_to_silver/copper_converter.tscn +++ b/converters/copper_to_silver/copper_converter.tscn @@ -136,5 +136,6 @@ 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/gold_to_coaldiamond/coal_diamond_converter.tscn b/converters/gold_to_coaldiamond/coal_diamond_converter.tscn index 899be96..b536e37 100644 --- a/converters/gold_to_coaldiamond/coal_diamond_converter.tscn +++ b/converters/gold_to_coaldiamond/coal_diamond_converter.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=24 format=3 uid="uid://clanhkk4sg47w"] +[gd_scene load_steps=26 format=3 uid="uid://clanhkk4sg47w"] [ext_resource type="Script" path="res://converters/converter.gd" id="1_mf1ls"] [ext_resource type="Texture2D" uid="uid://2dhqp2liete7" path="res://converters/gold_to_coaldiamond/diamond_converter_back.png" id="2_nj8gd"] @@ -13,6 +13,8 @@ [ext_resource type="PackedScene" uid="uid://diy8fj7mcc00p" path="res://entity/coal_diamond/coal.tscn" id="10_ry7ak"] [ext_resource type="AudioStream" uid="uid://7tw5efuo3gxj" path="res://audio/conversione/coin_to_coin.wav" id="11_5c46k"] [ext_resource type="PackedScene" uid="uid://bevj27e1ha8m3" path="res://converters/converter_placement_body.tscn" id="12_xld3l"] +[ext_resource type="AudioStream" uid="uid://du16ilpv6gmxd" path="res://audio/conversione/drop_in_lava.wav" id="13_jvouj"] +[ext_resource type="PackedScene" uid="uid://cr5tiep20hk0s" path="res://entity/coal_diamond/diamond.tscn" id="15_ey4am"] [sub_resource type="AtlasTexture" id="AtlasTexture_00uxa"] atlas = ExtResource("3_p4wsd") @@ -126,6 +128,9 @@ spawn_rotation_degrees_min = 80.0 spawn_rotation_degrees_max = 100.0 overlapping_body_count_limit = 4 +[node name="Diamond" parent="Spawner" instance=ExtResource("15_ey4am")] +position = Vector2(-34.3333, 1.66667) + [node name="PreventSpawnShape" type="CollisionShape2D" parent="Spawner"] z_index = 3 position = Vector2(0, 3.5) @@ -133,7 +138,6 @@ 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="SoundWorking" type="AudioStreamPlayer" parent="."] @@ -142,6 +146,10 @@ stream = ExtResource("10_hy4ck") [node name="SoundComplete" type="AudioStreamPlayer" parent="."] stream = ExtResource("11_5c46k") +[node name="SoundAbsorb" type="AudioStreamPlayer" parent="."] +stream = ExtResource("13_jvouj") +volume_db = -12.291 + [node name="ConverterPlacementBody" parent="." instance=ExtResource("12_xld3l")] [connection signal="collected" from="Collector" to="." method="_on_collector_collected" flags=18] diff --git a/entity/coal.png.import b/entity/coal.png.import new file mode 100644 index 0000000..f4bfd3a --- /dev/null +++ b/entity/coal.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cad2rtfm4iooa" +path="res://.godot/imported/coal.png-bae62eb66a24aa48a4fb6fc311fab196.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entity/coal.png" +dest_files=["res://.godot/imported/coal.png-bae62eb66a24aa48a4fb6fc311fab196.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/coin_copper/coin_copper.tscn b/entity/coin_copper/coin_copper.tscn index abd0c90..9297f4b 100644 --- a/entity/coin_copper/coin_copper.tscn +++ b/entity/coin_copper/coin_copper.tscn @@ -5,7 +5,7 @@ [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://ds2rl6eg5jr1" path="res://audio/tap/click5.wav" id="7_fxd28"] +[ext_resource type="AudioStream" uid="uid://wy7f2j0wg1ur" path="res://audio/tap/click5.wav" id="7_fxd28"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_c6byl"] size = Vector2(14, 3) @@ -49,4 +49,7 @@ volume_db = -24.397 wait_time = 2.108 one_shot = true +[connection signal="body_entered" from="." to="." method="_on_body_entered"] +[connection signal="body_exited" from="." to="." method="_on_body_exited"] +[connection signal="sleeping_state_changed" from="." to="." method="_on_sleeping_state_changed"] [connection signal="collected" from="Collectible" to="Collectible" method="_on_done"] diff --git a/entity/coin_gold/coin_gold.tscn b/entity/coin_gold/coin_gold.tscn index 2057d7f..011a7ee 100644 --- a/entity/coin_gold/coin_gold.tscn +++ b/entity/coin_gold/coin_gold.tscn @@ -7,7 +7,7 @@ [ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="5_palpv"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_c6byl"] -size = Vector2(27, 5) +size = Vector2(20, 16) [node name="CoinGold" type="RigidBody2D"] collision_layer = 4 diff --git a/game/game.tscn b/game/game.tscn index 99e48c3..390eaae 100644 --- a/game/game.tscn +++ b/game/game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=23 format=3 uid="uid://c3rxmcwa5nqng"] +[gd_scene load_steps=25 format=3 uid="uid://c3rxmcwa5nqng"] [ext_resource type="Script" path="res://game/game.gd" id="1_i3ly0"] [ext_resource type="PackedScene" uid="uid://bllsprv8orpn4" path="res://bottle/bottle.tscn" id="1_y7o2l"] @@ -16,7 +16,9 @@ [ext_resource type="Texture2D" uid="uid://c8pvjgtr2ufjl" path="res://interface/upgrade_copper.png" id="11_lt33g"] [ext_resource type="PackedScene" uid="uid://c3kitncwpi42j" path="res://entity/coin_copper/coin_copper.tscn" id="13_4j8om"] [ext_resource type="Script" path="res://game/DebugTimer.gd" id="13_6ai3c"] +[ext_resource type="PackedScene" uid="uid://du3005kwybbrh" path="res://entity/coin_gold/coin_gold.tscn" id="13_8ux81"] [ext_resource type="PackedScene" uid="uid://qtk4tm6l367w" path="res://interface/ghost.tscn" id="16_8vhx6"] +[ext_resource type="PackedScene" uid="uid://clanhkk4sg47w" path="res://converters/gold_to_coaldiamond/coal_diamond_converter.tscn" id="18_bjs6i"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_rh35r"] size = Vector2(240, 384) @@ -64,6 +66,7 @@ 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("13_8ux81") target = NodePath("..") buffer_cap = 1 spawn_rect = Rect2(-20, 0, 40, 0) @@ -75,6 +78,7 @@ shape = SubResource("RectangleShape2D_4uksi") debug_color = Color(0, 0.6, 0.701961, 0) [node name="Timer" type="Timer" parent="TimeSpawner"] +one_shot = true [node name="DebugSpawner" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_qwsty")] position = Vector2(136, 0) @@ -82,7 +86,7 @@ scene = ExtResource("13_4j8om") target = NodePath("..") buffer_cap = 1 spawn_rect = Rect2(-20, 0, 40, 0) -overlapping_body_count_limit = 16 +overlapping_body_count_limit = 128 metadata/_edit_lock_ = true [node name="NeckShape" type="CollisionShape2D" parent="DebugSpawner"] @@ -185,7 +189,15 @@ position = Vector2(405, 540) shape = SubResource("RectangleShape2D_jed57") debug_color = Color(0, 0, 0, 0.419608) +[node name="CoalDiamondConverter" parent="." instance=ExtResource("18_bjs6i")] +position = Vector2(140, 217) + +[node name="Spawner" parent="CoalDiamondConverter" index="6" node_paths=PackedStringArray("target")] +target = NodePath("../..") + [connection signal="changed" from="Bottle/Evaluator" to="." method="_on_score_changed"] [connection signal="timeout" from="TimeSpawner/Timer" to="TimeSpawner" method="spawn"] [connection signal="timeout" from="DebugSpawner/DebugTimer" to="DebugSpawner" method="spawn"] [connection signal="collected" from="StoreCollector" to="." method="_on_store_collector_collected"] + +[editable path="CoalDiamondConverter"] diff --git a/main.tscn b/main.tscn index ee10b53..b04b443 100644 --- a/main.tscn +++ b/main.tscn @@ -6,7 +6,7 @@ [ext_resource type="PackedScene" uid="uid://cklkdygv61bny" path="res://interface/shop_ui.tscn" id="2_qj86l"] [ext_resource type="Script" path="res://interface/custom_ui.gd" id="3_xav0n"] [ext_resource type="PackedScene" uid="uid://bo5unrhqpoyim" path="res://interface/game_ui.tscn" id="4_siim3"] -[ext_resource type="PackedScene" uid="uid://bpvx3nkkbluip" path="res://safe_ui.tscn" id="5_2uxda"] +[ext_resource type="PackedScene" path="res://safe_ui.tscn" id="5_2uxda"] [ext_resource type="Script" path="res://game_camera.gd" id="5_xxjtg"] [sub_resource type="GDScript" id="GDScript_kyj65"] diff --git a/spawner/spawner.gd b/spawner/spawner.gd index 08aba7a..c90ec95 100644 --- a/spawner/spawner.gd +++ b/spawner/spawner.gd @@ -54,6 +54,10 @@ func _do_spawn(): return if scene == null: return + if scene._bundled["names"][0]=="Coal": + var scene = PackedScene.new() + scene.pack(get_node("Diamond")) + print("ehi") var instantiated = scene.instantiate() instantiated.global_position = global_position + _select_spawn_position() instantiated.rotation_degrees = _select_spawn_rotation()