From fa6aaae60ee7cf514d6c2c6468cae4b23f710b9e Mon Sep 17 00:00:00 2001 From: Matteo Balugani Date: Sun, 1 Oct 2023 18:24:17 +0200 Subject: [PATCH 1/9] Fix physics timestep --- project.godot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project.godot b/project.godot index 81c5e97..cef41af 100644 --- a/project.godot +++ b/project.godot @@ -35,6 +35,8 @@ window/handheld/orientation=1 [physics] 2d/run_on_separate_thread=true +common/physics_ticks_per_second=240 +common/max_physics_steps_per_frame=30 2d/solver/solver_iterations=4 2d/solver/contact_max_separation=1.0 2d/solver/contact_max_allowed_penetration=0.02 From 10e5ffb146fda912825a73f75f15cb21bbf39965 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 1 Oct 2023 18:55:55 +0200 Subject: [PATCH 2/9] Further tweak physics properties --- project.godot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.godot b/project.godot index cef41af..fa9b1de 100644 --- a/project.godot +++ b/project.godot @@ -37,7 +37,7 @@ window/handheld/orientation=1 2d/run_on_separate_thread=true common/physics_ticks_per_second=240 common/max_physics_steps_per_frame=30 -2d/solver/solver_iterations=4 +2d/solver/solver_iterations=1 2d/solver/contact_max_separation=1.0 2d/solver/contact_max_allowed_penetration=0.02 2d/solver/default_contact_bias=0.0 From 61ac6599452c10d4dd3bb3a40dcd110e06430893 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 1 Oct 2023 18:56:15 +0200 Subject: [PATCH 3/9] Improve shop UI --- game/game.tscn | 2 + interface/purchasable_item.tscn | 2 +- interface/shop_ui.tscn | 98 +++++++++++++++++++-------------- 3 files changed, 60 insertions(+), 42 deletions(-) diff --git a/game/game.tscn b/game/game.tscn index e5a29fd..ff344a9 100644 --- a/game/game.tscn +++ b/game/game.tscn @@ -24,6 +24,8 @@ overlapping_bodies_collision_mask = 4 overlapping_body_count_limit = 4 [node name="Timer" type="Timer" parent="TimeSpawner"] +wait_time = 0.017 +autostart = true [node name="ButtonSpawner" parent="." instance=ExtResource("3_qwsty")] position = Vector2(0, -480) diff --git a/interface/purchasable_item.tscn b/interface/purchasable_item.tscn index ec2ab45..8e9b56b 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, 256) +custom_minimum_size = Vector2(0, 240) anchors_preset = 10 anchor_right = 1.0 grow_horizontal = 2 diff --git a/interface/shop_ui.tscn b/interface/shop_ui.tscn index 5d3641f..8990401 100644 --- a/interface/shop_ui.tscn +++ b/interface/shop_ui.tscn @@ -55,25 +55,36 @@ size_flags_horizontal = 8 text = "Back" alignment = 2 -[node name="Scrollable" type="ScrollContainer" parent="Rows"] -clip_contents = false +[node name="PaddedScrollable" type="HBoxContainer" parent="Rows"] layout_mode = 2 size_flags_vertical = 3 + +[node name="PaddedScrollableLeft" type="Control" parent="Rows/PaddedScrollable"] +custom_minimum_size = Vector2(8, 0) +layout_mode = 2 +size_flags_horizontal = 0 + +[node name="Scrollable" type="ScrollContainer" parent="Rows/PaddedScrollable"] +clip_contents = false +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +scroll_vertical = 100 horizontal_scroll_mode = 0 vertical_scroll_mode = 2 -[node name="ScrollableItems" type="VBoxContainer" parent="Rows/Scrollable"] +[node name="ScrollableItems" type="VBoxContainer" parent="Rows/PaddedScrollable/Scrollable"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="ConvertCategory" type="VBoxContainer" parent="Rows/Scrollable/ScrollableItems"] +[node name="ConvertCategory" type="VBoxContainer" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems"] layout_mode = 2 -[node name="PurchasableItemPadding5" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding5" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="ImproveYourItemsLabel" type="Label" parent="Rows/Scrollable/ScrollableItems/ConvertCategory"] +[node name="ImproveYourItemsLabel" type="Label" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory"] layout_mode = 2 theme_override_font_sizes/font_size = 24 text = "Improve your items!" @@ -82,10 +93,10 @@ vertical_alignment = 1 autowrap_mode = 2 uppercase = true -[node name="PurchasableItemPadding3" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding3" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuySilverifier" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] +[node name="BuySilverifier" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_icon = ExtResource("5_lu2tr") item_name = "Silverifier" @@ -94,56 +105,56 @@ item_cost_text = "35 copper" item_cost_type = &"Copper" item_cost_goal = 35 -[node name="PurchasableItemPadding" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuyGoldenser" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] +[node name="BuyGoldenser" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Goldenser" item_description = "Trades in ten silver coins for a sparkly gold coin!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding2" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding2" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuyGemificator" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] +[node name="BuyGemificator" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Gemificator" item_description = "Converts ten gold coins into a randomly colored gem!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding4" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding4" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuyCompressor" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] +[node name="BuyCompressor" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Compressor" 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 -[node name="PurchasableItemPadding6" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding6" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuyArtifactomatic" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] +[node name="BuyArtifactomatic" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Artifactic" item_description = "Assembles an artifact from twenty-five gold coins and a gem or a diamond!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding7" parent="Rows/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding7" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ConvertCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="ManualCategory" type="VBoxContainer" parent="Rows/Scrollable/ScrollableItems"] +[node name="ManualCategory" type="VBoxContainer" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems"] layout_mode = 2 -[node name="PurchasableItemPadding5" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding5" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="EarnCoinsLabel" type="Label" parent="Rows/Scrollable/ScrollableItems/ManualCategory"] +[node name="EarnCoinsLabel" type="Label" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory"] layout_mode = 2 theme_override_font_sizes/font_size = 24 text = "Get rich quick!" @@ -152,76 +163,76 @@ vertical_alignment = 1 autowrap_mode = 2 uppercase = true -[node name="PurchasableItemPadding3" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding3" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuyAutoCopper" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] +[node name="BuyAutoCopper" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Auto-copper" item_description = "Receive two copper coins per second!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuyHeliCopper" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] +[node name="BuyHeliCopper" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Heli-copper" item_description = "Receive eight copper coins per second!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding2" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding2" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuyAutoSilver" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] +[node name="BuyAutoSilver" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Auto-silver" item_description = "Receive two silver coins per second!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding4" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding4" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuySuperSilver" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] +[node name="BuySuperSilver" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Super silver" item_description = "Receive eight silver coins per second!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding6" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding6" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuyAutoGold" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] +[node name="BuyAutoGold" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Auto-gold" item_description = "Receive two gold coins per second!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding7" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding7" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuyMidasTouch" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] +[node name="BuyMidasTouch" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Midas Touch" item_description = "Receive eight gold coins per second!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding8" parent="Rows/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding8" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="AutomaticCategory" type="VBoxContainer" parent="Rows/Scrollable/ScrollableItems"] +[node name="AutomaticCategory" type="VBoxContainer" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems"] layout_mode = 2 -[node name="PurchasableItemPadding5" parent="Rows/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding5" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="EarnCoinsLabel" type="Label" parent="Rows/Scrollable/ScrollableItems/AutomaticCategory"] +[node name="EarnCoinsLabel" type="Label" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/AutomaticCategory"] layout_mode = 2 theme_override_font_sizes/font_size = 24 text = "Automatic coin dropper" @@ -230,29 +241,34 @@ vertical_alignment = 1 autowrap_mode = 2 uppercase = true -[node name="PurchasableItemPadding3" parent="Rows/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding3" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuySilverStar" parent="Rows/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("2_2dtc0")] +[node name="BuySilverStar" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Silver star" item_description = "Create a silver coin when tapping!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding" parent="Rows/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 -[node name="BuyGoldStar" parent="Rows/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("2_2dtc0")] +[node name="BuyGoldStar" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("2_2dtc0")] layout_mode = 2 item_name = "Gold star" item_description = "Create a gold coin when tapping!" item_cost_text = "??" has_unlocked = false -[node name="PurchasableItemPadding2" parent="Rows/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("3_4feaj")] +[node name="PurchasableItemPadding2" parent="Rows/PaddedScrollable/Scrollable/ScrollableItems/AutomaticCategory" instance=ExtResource("3_4feaj")] layout_mode = 2 +[node name="PaddedScrollableRight" type="Control" parent="Rows/PaddedScrollable"] +custom_minimum_size = Vector2(8, 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"] From e54658017653039b8f5a25f19d66b22ee218672a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 1 Oct 2023 18:56:21 +0200 Subject: [PATCH 4/9] Restore copper coin properties --- entity/coin_copper.tscn | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/entity/coin_copper.tscn b/entity/coin_copper.tscn index 20fb5ea..c074eea 100644 --- a/entity/coin_copper.tscn +++ b/entity/coin_copper.tscn @@ -1,13 +1,12 @@ -[gd_scene load_steps=7 format=3 uid="uid://c3kitncwpi42j"] +[gd_scene load_steps=6 format=3 uid="uid://c3kitncwpi42j"] [ext_resource type="PhysicsMaterial" uid="uid://c6kn1an85lccr" path="res://entity/coin_physics_material.tres" id="1_8k46m"] [ext_resource type="Texture2D" uid="uid://dbdkb4vt7dh85" path="res://entity/coin_copper_4.png" id="1_wedw1"] [ext_resource type="Texture2D" uid="uid://2vtvoj6ua3cb" path="res://entity/coin_copper_outline_2.png" id="2_2ifq3"] [ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="4_yefrx"] -[ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="5_jdvvd"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_c6byl"] -size = Vector2(16, 5) +size = Vector2(14, 3) [node name="CoinCopper" type="RigidBody2D"] collision_layer = 5 @@ -19,7 +18,7 @@ linear_damp = 0.1 angular_damp = 0.1 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -scale = Vector2(3, 3) +scale = Vector2(2, 2) shape = SubResource("RectangleShape2D_c6byl") [node name="Sprite" type="Sprite2D" parent="CollisionShape2D"] @@ -33,6 +32,3 @@ texture = ExtResource("2_2ifq3") [node name="Collectible" parent="." instance=ExtResource("4_yefrx")] type = &"Copper" - -[node name="Valuable" parent="." instance=ExtResource("5_jdvvd")] -value = 1 From 37171ce359b0dcd87ca21af7e918c3c7476a2335 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 1 Oct 2023 19:49:06 +0200 Subject: [PATCH 5/9] Import new sprites --- entity/diamond.png.import | 34 ++++++++++++++++++++++++++++++++ entity/gemstone.png.import | 34 ++++++++++++++++++++++++++++++++ entity/upgrade_copper.png.import | 34 ++++++++++++++++++++++++++++++++ entity/upgrade_gold.png.import | 34 ++++++++++++++++++++++++++++++++ entity/upgrade_silver.png.import | 34 ++++++++++++++++++++++++++++++++ 5 files changed, 170 insertions(+) create mode 100644 entity/diamond.png.import create mode 100644 entity/gemstone.png.import create mode 100644 entity/upgrade_copper.png.import create mode 100644 entity/upgrade_gold.png.import create mode 100644 entity/upgrade_silver.png.import diff --git a/entity/diamond.png.import b/entity/diamond.png.import new file mode 100644 index 0000000..56ce840 --- /dev/null +++ b/entity/diamond.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bquk2q5g6bst5" +path="res://.godot/imported/diamond.png-e255ab09d23a24a6563c34236c6422d4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entity/diamond.png" +dest_files=["res://.godot/imported/diamond.png-e255ab09d23a24a6563c34236c6422d4.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/gemstone.png.import b/entity/gemstone.png.import new file mode 100644 index 0000000..54c98b2 --- /dev/null +++ b/entity/gemstone.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b21bsbo5f0ed7" +path="res://.godot/imported/gemstone.png-9e77a54275f3114b69765356c5f68288.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entity/gemstone.png" +dest_files=["res://.godot/imported/gemstone.png-9e77a54275f3114b69765356c5f68288.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/upgrade_copper.png.import b/entity/upgrade_copper.png.import new file mode 100644 index 0000000..a785e3b --- /dev/null +++ b/entity/upgrade_copper.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8pvjgtr2ufjl" +path="res://.godot/imported/upgrade_copper.png-92818496e71584b34e672f67618f806c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entity/upgrade_copper.png" +dest_files=["res://.godot/imported/upgrade_copper.png-92818496e71584b34e672f67618f806c.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/upgrade_gold.png.import b/entity/upgrade_gold.png.import new file mode 100644 index 0000000..1cb0962 --- /dev/null +++ b/entity/upgrade_gold.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://taojrwr7xrp4" +path="res://.godot/imported/upgrade_gold.png-a48bc75df5dc8202543af64ada12eda4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entity/upgrade_gold.png" +dest_files=["res://.godot/imported/upgrade_gold.png-a48bc75df5dc8202543af64ada12eda4.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/upgrade_silver.png.import b/entity/upgrade_silver.png.import new file mode 100644 index 0000000..33c1ebb --- /dev/null +++ b/entity/upgrade_silver.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7b12rwclhrq0" +path="res://.godot/imported/upgrade_silver.png-50b5b05efdbda1c035ad16dd8135bc03.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entity/upgrade_silver.png" +dest_files=["res://.godot/imported/upgrade_silver.png-50b5b05efdbda1c035ad16dd8135bc03.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 From f7b49e5d9240c7adae9d391c4a69602050454d54 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 1 Oct 2023 19:49:30 +0200 Subject: [PATCH 6/9] Set project icon --- project.godot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.godot b/project.godot index fa9b1de..795836b 100644 --- a/project.godot +++ b/project.godot @@ -15,7 +15,7 @@ run/main_scene="res://root.tscn" config/features=PackedStringArray("4.1", "Mobile") boot_splash/bg_color=Color(0.0977035, 0.0977035, 0.10161, 1) boot_splash/image="res://icon.png" -config/icon="res://icon.svg" +config/icon="res://icon.png" [display] From 5a328c58176d6bbaa715188b0dc00decd2382cdf Mon Sep 17 00:00:00 2001 From: Matteo Balugani Date: Sun, 1 Oct 2023 21:58:20 +0200 Subject: [PATCH 7/9] added silver coin --- entity/coin_silver.tscn | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 entity/coin_silver.tscn diff --git a/entity/coin_silver.tscn b/entity/coin_silver.tscn new file mode 100644 index 0000000..74ae7ed --- /dev/null +++ b/entity/coin_silver.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=7 format=3 uid="uid://dme22vvfgme5f"] + +[ext_resource type="PhysicsMaterial" uid="uid://c6kn1an85lccr" path="res://entity/coin_physics_material.tres" id="1_4sq1a"] +[ext_resource type="Texture2D" uid="uid://m5t74cw8ht5b" path="res://entity/coin_silver_2.png" id="2_0u0up"] +[ext_resource type="Texture2D" uid="uid://beikajpd08pwr" path="res://entity/coin_silver_outline_2.png" id="3_nxu2p"] +[ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="4_12sii"] +[ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="5_u3bvw"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_c6byl"] +size = Vector2(23, 6.16667) + +[node name="CoinSilver" type="RigidBody2D"] +collision_layer = 5 +collision_mask = 7 +inertia = 20000.0 +physics_material_override = ExtResource("1_4sq1a") +continuous_cd = 1 +linear_damp = 0.1 +angular_damp = 0.1 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +scale = Vector2(2, 2) +shape = SubResource("RectangleShape2D_c6byl") + +[node name="Sprite" type="Sprite2D" parent="CollisionShape2D"] +texture_filter = 1 +texture = ExtResource("2_0u0up") + +[node name="Outline" type="Sprite2D" parent="CollisionShape2D"] +z_index = -10 +texture_filter = 1 +texture = ExtResource("3_nxu2p") + +[node name="Collectible" parent="." instance=ExtResource("4_12sii")] +type = &"Silver" + +[node name="Valuable" parent="." instance=ExtResource("5_u3bvw")] +value = 10 From caa23a5dee79a544e54bec1b2dd42dccd50265b9 Mon Sep 17 00:00:00 2001 From: Matteo Balugani Date: Sun, 1 Oct 2023 21:58:40 +0200 Subject: [PATCH 8/9] added copper to silver converter --- convertors/copper_to_silver.gd | 17 ++++++++++++++++ convertors/copper_to_silver.tscn | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 convertors/copper_to_silver.gd create mode 100644 convertors/copper_to_silver.tscn diff --git a/convertors/copper_to_silver.gd b/convertors/copper_to_silver.gd new file mode 100644 index 0000000..8d07388 --- /dev/null +++ b/convertors/copper_to_silver.gd @@ -0,0 +1,17 @@ +extends StaticBody2D + +@export var scene: PackedScene + +func _on_collector_collected(body): + body.queue_free() + + +func _on_collector_goal(): + print("silver coin") + var scene_instant = scene.instantiate() + print(position) + print(scene_instant.position) + scene_instant.set_position(position) + print(scene_instant.position) + add_child(scene_instant) + #emit_signal("spawned", scene_instant) diff --git a/convertors/copper_to_silver.tscn b/convertors/copper_to_silver.tscn new file mode 100644 index 0000000..b490830 --- /dev/null +++ b/convertors/copper_to_silver.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=6 format=3 uid="uid://ratkps4plkhl"] + +[ext_resource type="Script" path="res://convertors/copper_to_silver.gd" id="1_jjv83"] +[ext_resource type="PackedScene" uid="uid://dme22vvfgme5f" path="res://entity/coin_silver.tscn" id="2_orv64"] +[ext_resource type="Texture2D" uid="uid://b0uefih0ccwp3" path="res://entity/copper_converter_front_1.png" id="2_vm6by"] +[ext_resource type="PackedScene" uid="uid://c5w3b55aiui6c" path="res://collector/collector.tscn" id="3_a4naa"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_k11if"] +size = Vector2(26, 5) + +[node name="CopperToSilver" type="StaticBody2D"] +scale = Vector2(3, 3) +script = ExtResource("1_jjv83") +scene = ExtResource("2_orv64") + +[node name="CopperConverterFront1" type="Sprite2D" parent="."] +texture_filter = 1 +texture = ExtResource("2_vm6by") + +[node name="Collector" parent="." instance=ExtResource("3_a4naa")] +collecting_types = Array[StringName]([&"Copper"]) +collecting_collision_mask = 4 +collecting_amount = 1 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Collector"] +position = Vector2(0, 9.5) +shape = SubResource("RectangleShape2D_k11if") + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] +polygon = PackedVector2Array(-16, -15.5, -13, -15.5, -13, 12, 13, 12, 13, -15.5, 16, -15.5, 16, 14.5, -16, 14.5) + +[connection signal="collected" from="Collector" to="." method="_on_collector_collected"] +[connection signal="goal" from="Collector" to="." method="_on_collector_goal"] From 30464356aa68e8761027a5a4c05381ddf70655fe Mon Sep 17 00:00:00 2001 From: Matteo Balugani Date: Sun, 1 Oct 2023 21:58:56 +0200 Subject: [PATCH 9/9] debug things --- collector/collector.gd | 3 ++- entity/coin_copper.tscn | 3 +-- game/game.gd | 1 + game/game.tscn | 7 ++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/collector/collector.gd b/collector/collector.gd index c9a4266..d05e58b 100644 --- a/collector/collector.gd +++ b/collector/collector.gd @@ -20,13 +20,14 @@ var collected_count: int = 0 @export var collecting_amount: int ## The collector has picked up an object. -signal collected(what: PhysicsBody2D) +signal collected(body: PhysicsBody2D) ## The collector has received its collection goal and is about to reset. signal goal func _on_body_entered(body: Node2D): + if body is PhysicsBody2D: if body.collision_layer & collecting_collision_mask: var collectible: Collectible = body.get_node("Collectible") diff --git a/entity/coin_copper.tscn b/entity/coin_copper.tscn index 20fb5ea..c707d68 100644 --- a/entity/coin_copper.tscn +++ b/entity/coin_copper.tscn @@ -7,7 +7,7 @@ [ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="5_jdvvd"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_c6byl"] -size = Vector2(16, 5) +size = Vector2(16.5, 5.08333) [node name="CoinCopper" type="RigidBody2D"] collision_layer = 5 @@ -19,7 +19,6 @@ linear_damp = 0.1 angular_damp = 0.1 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -scale = Vector2(3, 3) shape = SubResource("RectangleShape2D_c6byl") [node name="Sprite" type="Sprite2D" parent="CollisionShape2D"] diff --git a/game/game.gd b/game/game.gd index e2e8253..33de062 100644 --- a/game/game.gd +++ b/game/game.gd @@ -7,3 +7,4 @@ class_name Game func trigger_spawn(): button_spawner.spawn() + diff --git a/game/game.tscn b/game/game.tscn index e5a29fd..6b12a48 100644 --- a/game/game.tscn +++ b/game/game.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=6 format=3 uid="uid://c3rxmcwa5nqng"] +[gd_scene load_steps=7 format=3 uid="uid://c3rxmcwa5nqng"] [ext_resource type="Script" path="res://game/game.gd" id="1_i3ly0"] [ext_resource type="PackedScene" uid="uid://bllsprv8orpn4" path="res://bottle/bottle.tscn" id="1_y7o2l"] [ext_resource type="PackedScene" uid="uid://d05b8jy3xmpcb" path="res://bottle/gravity_from_gyro.tscn" id="2_h2pfr"] [ext_resource type="PackedScene" uid="uid://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="3_qwsty"] [ext_resource type="PackedScene" uid="uid://c3kitncwpi42j" path="res://entity/coin_copper.tscn" id="4_e5nwi"] +[ext_resource type="PackedScene" uid="uid://ratkps4plkhl" path="res://convertors/copper_to_silver.tscn" id="6_tf2pv"] [node name="Game" type="Node2D"] texture_filter = 1 @@ -14,6 +15,10 @@ script = ExtResource("1_i3ly0") [node name="GravityFromGyro" parent="Bottle" instance=ExtResource("2_h2pfr")] +[node name="CopperToSilver" parent="." instance=ExtResource("6_tf2pv")] +z_index = 10 +position = Vector2(2, -314) + [node name="TimeSpawner" parent="." instance=ExtResource("3_qwsty")] position = Vector2(0, -480) scene = ExtResource("4_e5nwi")