From e6daeb6139cfbb7d807007bdd6c004155b946233 Mon Sep 17 00:00:00 2001 From: Maxim Lobovsky Date: Sun, 1 Oct 2023 23:54:00 +0200 Subject: [PATCH 1/4] add glass tileset --- entity/glass_tileset.png | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 entity/glass_tileset.png diff --git a/entity/glass_tileset.png b/entity/glass_tileset.png new file mode 100644 index 0000000..36671ec --- /dev/null +++ b/entity/glass_tileset.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efe9199a385910285cf8edcd517c874ec4ba55369e4c4b6c185a1b733b8b327f +size 1440 From dab52d774048a8e6759c05d5dfa8c3d2073bd880 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 1 Oct 2023 23:56:12 +0200 Subject: [PATCH 2/4] Import new textures --- entity/coin_gold.png.import | 2 +- entity/coin_gold_outline.png.import | 2 +- entity/silver_converter_back.png.import | 2 +- entity/silver_converter_front_1.png.import | 2 +- entity/silver_converter_front_2.png.import | 2 +- entity/silver_converter_front_3.png.import | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/entity/coin_gold.png.import b/entity/coin_gold.png.import index 0c96ad2..5e404ce 100644 --- a/entity/coin_gold.png.import +++ b/entity/coin_gold.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://qy1fubii8tqi" +uid="uid://dxtstvjlten8p" path="res://.godot/imported/coin_gold.png-0c230a4cf47b2f846ae95a49942eff1e.ctex" metadata={ "vram_texture": false diff --git a/entity/coin_gold_outline.png.import b/entity/coin_gold_outline.png.import index 1d4a936..07c9dbb 100644 --- a/entity/coin_gold_outline.png.import +++ b/entity/coin_gold_outline.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://blfyda7vw3q3h" +uid="uid://bwqsdmghnrmhy" path="res://.godot/imported/coin_gold_outline.png-a9a15b5756ee7fa7d320f210be0aa93e.ctex" metadata={ "vram_texture": false diff --git a/entity/silver_converter_back.png.import b/entity/silver_converter_back.png.import index caa152c..b788500 100644 --- a/entity/silver_converter_back.png.import +++ b/entity/silver_converter_back.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dky53nnnsqrf3" +uid="uid://c1fu70mb51gyd" path="res://.godot/imported/silver_converter_back.png-04ef08ef1c6ba3a7ef842e74e84ab87a.ctex" metadata={ "vram_texture": false diff --git a/entity/silver_converter_front_1.png.import b/entity/silver_converter_front_1.png.import index 66ae210..a1ffbed 100644 --- a/entity/silver_converter_front_1.png.import +++ b/entity/silver_converter_front_1.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://5320c0lts3sb" +uid="uid://d3xa3cqu73xjd" path="res://.godot/imported/silver_converter_front_1.png-ef096085a3520f98616dff5262520f12.ctex" metadata={ "vram_texture": false diff --git a/entity/silver_converter_front_2.png.import b/entity/silver_converter_front_2.png.import index 6c35e3d..e5fc6c0 100644 --- a/entity/silver_converter_front_2.png.import +++ b/entity/silver_converter_front_2.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://xocipqvibphg" +uid="uid://cwycuwkppcjfu" path="res://.godot/imported/silver_converter_front_2.png-04833d844d5196d082aa61a07f77cad8.ctex" metadata={ "vram_texture": false diff --git a/entity/silver_converter_front_3.png.import b/entity/silver_converter_front_3.png.import index 3632ad8..ed5fcd6 100644 --- a/entity/silver_converter_front_3.png.import +++ b/entity/silver_converter_front_3.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://c7lgajcnb0hxs" +uid="uid://b006dig4oebpl" path="res://.godot/imported/silver_converter_front_3.png-ba3e375be79147732d0a2cccd2e35d9d.ctex" metadata={ "vram_texture": false From b713c3acb9482c49c1fdc015ed0975a0dc47e2d7 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 1 Oct 2023 23:56:25 +0200 Subject: [PATCH 3/4] WIP stuff just for merge --- bottle/bottle.tscn | 7 ------- game/game.tscn | 15 +++++++-------- root.gd | 4 ---- root.tscn | 2 +- spawner/spawner.gd | 5 +++-- 5 files changed, 11 insertions(+), 22 deletions(-) diff --git a/bottle/bottle.tscn b/bottle/bottle.tscn index 0589b47..b17133b 100644 --- a/bottle/bottle.tscn +++ b/bottle/bottle.tscn @@ -16,10 +16,3 @@ tile_set = SubResource("TileSet_tr7be") collision_visibility_mode = 1 format = 2 layer_0/tile_data = PackedInt32Array(-1376264, 0, 0, -1310728, 0, 0, -1245192, 0, 0, -393224, 0, 0, -327688, 0, 0, -262152, 0, 0, -458760, 0, 0, -524296, 0, 0, -589832, 0, 0, -655368, 0, 0, -720904, 0, 0, -786440, 0, 0, -851976, 0, 0, -917512, 0, 0, -983048, 0, 0, -1048584, 0, 0, -1114120, 0, 0, -1179656, 0, 0, -196616, 0, 0, -131080, 0, 0, -65544, 0, 0, -8, 0, 0, -7, 0, 0, -4, 0, 0, -3, 0, 0, -2, 0, 0, -1, 0, 0, -5, 0, 0, -6, 0, 0, -65536, 0, 0, -65535, 0, 0, -65534, 0, 0, -65533, 0, 0, -65532, 0, 0, -65531, 0, 0, -65530, 0, 0, -65529, 0, 0, -131065, 0, 0, -196601, 0, 0, -262137, 0, 0, -327673, 0, 0, -393209, 0, 0, -458745, 0, 0, -524281, 0, 0, -589817, 0, 0, -655353, 0, 0, -720889, 0, 0, -786425, 0, 0, -851961, 0, 0, -917497, 0, 0, -983033, 0, 0, -1048569, 0, 0, -1114105, 0, 0, -1441785, 0, 0, -1376249, 0, 0, -1310713, 0, 0, -1245177, 0, 0, -1179641, 0, 0, -1638404, 0, 0, -1703933, 0, 0, -1572868, 0, 0, -1507332, 0, 0, -1441796, 0, 0, -1376260, 0, 0, -1376261, 0, 0, -1376262, 0, 0, -1376263, 0, 0, -1638397, 0, 0, -1572861, 0, 0, -1507325, 0, 0, -1441789, 0, 0, -1441788, 0, 0, -1441787, 0, 0, -1441786, 0, 0) - -[node name="StaticBody2D" type="StaticBody2D" parent="."] -collision_layer = 3 -collision_mask = 0 - -[node name="Poly" type="CollisionPolygon2D" parent="StaticBody2D"] -polygon = PackedVector2Array(-320, -576, -320, 192, 320, 192, 320, -576, 48, -576, 48, -336, 112, -336, 112, -16, -112, -16, -112, -336, -48, -336, -48, -576) diff --git a/game/game.tscn b/game/game.tscn index 81f9092..98bb783 100644 --- a/game/game.tscn +++ b/game/game.tscn @@ -1,11 +1,10 @@ -[gd_scene load_steps=7 format=3 uid="uid://c3rxmcwa5nqng"] +[gd_scene load_steps=6 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 @@ -16,13 +15,10 @@ position = Vector2(0, 240) [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")] +[node name="TimeSpawner" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_qwsty")] position = Vector2(0, -144) scene = ExtResource("4_e5nwi") +target = NodePath("..") buffer_cap = 1 spawn_position_range_x = 32.0 spawn_rotation_range = 15.0 @@ -30,10 +26,13 @@ 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")] +[node name="ButtonSpawner" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_qwsty")] position = Vector2(0, -144) scene = ExtResource("4_e5nwi") +target = NodePath("..") buffer_cap = 50 spawn_position_range_x = 32.0 spawn_rotation_range = 15.0 diff --git a/root.gd b/root.gd index 9ba5ed7..4cf1b2e 100644 --- a/root.gd +++ b/root.gd @@ -3,7 +3,6 @@ class_name Root @onready var tree: SceneTree = get_tree() -@onready var game: Game = $UI/GameContainer/Game @onready var game_ui: GameUI = $UI/GameUI @onready var shop_ui: ShopUI = $UI/ShopUI @@ -46,8 +45,5 @@ func _on_shop_ui_score_button_pressed(): func _on_game_ui_shop_button_pressed(): ui_state = UIState.SHOP -func _on_game_ui_spawn_button_pressed(): - game.trigger_spawn() - func _on_shop_ui_purchase_begin(_what): ui_state = UIState.GAME diff --git a/root.tscn b/root.tscn index 8712d88..5633eb1 100644 --- a/root.tscn +++ b/root.tscn @@ -60,7 +60,7 @@ layout_mode = 2 [connection signal="score_button_pressed" from="View/SafeUI/GameUI" to="." method="_on_game_ui_score_button_pressed"] [connection signal="shop_button_pressed" from="View/SafeUI/GameUI" to="." method="_on_game_ui_shop_button_pressed"] -[connection signal="spawn_button_pressed" from="View/SafeUI/GameUI" to="." method="_on_game_ui_spawn_button_pressed"] +[connection signal="spawn_button_pressed" from="View/SafeUI/GameUI" to="View/GameWI/GameWorld/Game" method="trigger_spawn"] [connection signal="back_button_pressed" from="View/SafeUI/ShopUI" to="." method="_on_shop_ui_back_button_pressed"] [connection signal="delete_button_pressed" from="View/SafeUI/ShopUI" to="." method="_on_shop_ui_delete_button_pressed"] [connection signal="purchase_begin" from="View/SafeUI/ShopUI" to="." method="_on_shop_ui_purchase_begin"] diff --git a/spawner/spawner.gd b/spawner/spawner.gd index ca416ce..25f02f5 100644 --- a/spawner/spawner.gd +++ b/spawner/spawner.gd @@ -3,6 +3,7 @@ class_name Spawner @export var scene: PackedScene +@export var target: Node var buffer: int = 0 @export var buffer_cap: int @@ -43,9 +44,9 @@ func _do_spawn(): if _count_overlapping_bodies() > overlapping_body_count_limit: return var scene_instant = scene.instantiate() - scene_instant.position = _select_spawn_position() + scene_instant.global_position = global_position + _select_spawn_position() scene_instant.rotation_degrees = _select_spawn_rotation() - add_child(scene_instant) + target.add_child(scene_instant) emit_signal("spawned", scene_instant) buffer -= 1 From 6e9e2ebac9eb9364fbf52699d4f4a09697b38eb4 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 1 Oct 2023 23:58:47 +0200 Subject: [PATCH 4/4] Import yet another texture --- entity/glass_tileset.png.import | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 entity/glass_tileset.png.import diff --git a/entity/glass_tileset.png.import b/entity/glass_tileset.png.import new file mode 100644 index 0000000..c307a6f --- /dev/null +++ b/entity/glass_tileset.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://vmedndbi8crf" +path="res://.godot/imported/glass_tileset.png-57c4af482ec4effcdc3bd1c8bfc5a751.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entity/glass_tileset.png" +dest_files=["res://.godot/imported/glass_tileset.png-57c4af482ec4effcdc3bd1c8bfc5a751.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