1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-22 07:44:17 +00:00

coal_diamond_converter_manca switch

This commit is contained in:
Matteo Balugani 2023-10-02 20:44:53 +02:00
parent c105e25728
commit 91cd49e103
7 changed files with 27 additions and 16 deletions

View file

@ -9,8 +9,8 @@
[ext_resource type="PackedScene" uid="uid://c5w3b55aiui6c" path="res://collector/collector.tscn" id="7_rxm8j"] [ext_resource type="PackedScene" uid="uid://c5w3b55aiui6c" path="res://collector/collector.tscn" id="7_rxm8j"]
[ext_resource type="Texture2D" uid="uid://b3vbqgitwo8la" path="res://converters/gold_to_coaldiamond/diamond_converter_front_5.png" id="7_swl1g"] [ext_resource type="Texture2D" uid="uid://b3vbqgitwo8la" path="res://converters/gold_to_coaldiamond/diamond_converter_front_5.png" id="7_swl1g"]
[ext_resource type="PackedScene" uid="uid://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="8_yel0k"] [ext_resource type="PackedScene" uid="uid://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="8_yel0k"]
[ext_resource type="PackedScene" uid="uid://dme22vvfgme5f" path="res://entity/coin_silver/coin_silver.tscn" id="9_nosjr"]
[ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="10_hy4ck"] [ext_resource type="AudioStream" uid="uid://br25ip30mu174" path="res://audio/conversione/mechanic_sound.wav" id="10_hy4ck"]
[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="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="PackedScene" uid="uid://bevj27e1ha8m3" path="res://converters/converter_placement_body.tscn" id="12_xld3l"]
@ -70,11 +70,16 @@ size = Vector2(26, 5)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jeo5f"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_jeo5f"]
size = Vector2(26, 10) size = Vector2(26, 10)
[node name="CoalDiamondConverter" type="StaticBody2D"] [node name="CoalDiamondConverter" type="StaticBody2D" node_paths=PackedStringArray("sprite_front", "conversion_timer", "sound_working", "sound_complete", "spawner")]
scale = Vector2(3, 3) scale = Vector2(3, 3)
collision_layer = 8 collision_layer = 8
collision_mask = 0 collision_mask = 0
script = ExtResource("1_mf1ls") script = ExtResource("1_mf1ls")
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="."] [node name="SpriteBack" type="Sprite2D" parent="."]
z_index = -2 z_index = -2
@ -114,7 +119,7 @@ debug_color = Color(0, 0.701961, 0.188235, 0.419608)
[node name="Spawner" parent="." instance=ExtResource("8_yel0k")] [node name="Spawner" parent="." instance=ExtResource("8_yel0k")]
position = Vector2(0, 8) position = Vector2(0, 8)
scene = ExtResource("9_nosjr") scene = ExtResource("10_ry7ak")
buffer_cap = 1 buffer_cap = 1
spawn_rect = Rect2(-8, 0, 16, 4) spawn_rect = Rect2(-8, 0, 16, 4)
spawn_rotation_degrees_min = 80.0 spawn_rotation_degrees_min = 80.0

View file

@ -31,5 +31,6 @@ texture = ExtResource("2_abwth")
type = &"Diamond" type = &"Diamond"
[node name="Valuable" parent="." instance=ExtResource("4_yfos5")] [node name="Valuable" parent="." instance=ExtResource("4_yfos5")]
value = 1000
[connection signal="collected" from="Collectible" to="Collectible" method="_on_done" flags=18] [connection signal="collected" from="Collectible" to="Collectible" method="_on_done" flags=18]

View file

@ -49,4 +49,7 @@ volume_db = -24.397
wait_time = 2.108 wait_time = 2.108
one_shot = true 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"] [connection signal="collected" from="Collectible" to="Collectible" method="_on_done"]

View file

@ -7,7 +7,7 @@
[ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="5_palpv"] [ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="5_palpv"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_c6byl"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_c6byl"]
size = Vector2(27, 5) size = Vector2(20, 16)
[node name="CoinGold" type="RigidBody2D"] [node name="CoinGold" type="RigidBody2D"]
collision_layer = 4 collision_layer = 4

View file

@ -71,7 +71,6 @@ func update_counter_text():
@export var upgrade_copper_texture: Texture2D @export var upgrade_copper_texture: Texture2D
@export var upgrade_silver_texture: Texture2D @export var upgrade_silver_texture: Texture2D
@export var upgrade_gold_texture: Texture2D @export var upgrade_gold_texture: Texture2D
@export var upgrade_gem_texture: Texture2D
func update_counter_icon(): func update_counter_icon():
if len(store_collector.collecting_types) == 0: if len(store_collector.collecting_types) == 0:
@ -82,8 +81,6 @@ func update_counter_icon():
store_collector_texturerect.texture = upgrade_silver_texture store_collector_texturerect.texture = upgrade_silver_texture
elif store_collector.collecting_types[0] == &"Gold": elif store_collector.collecting_types[0] == &"Gold":
store_collector_texturerect.texture = upgrade_gold_texture store_collector_texturerect.texture = upgrade_gold_texture
elif store_collector.collecting_types[0] == &"Gem":
store_collector_texturerect.texture = upgrade_gem_texture
else: else:
store_collector_texturerect.texture = null store_collector_texturerect.texture = null
@ -95,8 +92,6 @@ func _on_ghost_requested(scene: PackedScene, texture: Texture2D):
func _on_ghost_materialize(): func _on_ghost_materialize():
var instantiated = ghost.materialize() var instantiated = ghost.materialize()
if not instantiated:
return #TODO FIXME
var spawner = instantiated.find_child("Spawner") var spawner = instantiated.find_child("Spawner")
if spawner != null: if spawner != null:
spawner.target = self spawner.target = self

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=24 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="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://bllsprv8orpn4" path="res://bottle/bottle.tscn" id="1_y7o2l"]
@ -6,7 +6,6 @@
[ext_resource type="Texture2D" uid="uid://7b12rwclhrq0" path="res://interface/upgrade_silver.png" id="3_8wvr1"] [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://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="3_qwsty"]
[ext_resource type="Texture2D" uid="uid://taojrwr7xrp4" path="res://interface/upgrade_gold.png" id="4_i557v"] [ext_resource type="Texture2D" uid="uid://taojrwr7xrp4" path="res://interface/upgrade_gold.png" id="4_i557v"]
[ext_resource type="Texture2D" uid="uid://yx3gme4q4ote" path="res://interface/upgrade_gem.png" id="5_wbw72"]
[ext_resource type="Texture2D" uid="uid://pj3ip6vlatms" path="res://converters/copper_to_silver/copper_converter.png" id="6_0jj8g"] [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://beg758fa6o0cs" path="res://value/evaluator.tscn" id="6_my6nv"]
[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://ratkps4plkhl" path="res://converters/copper_to_silver/copper_converter.tscn" id="7_ipeok"]
@ -17,7 +16,9 @@
[ext_resource type="Texture2D" uid="uid://c8pvjgtr2ufjl" path="res://interface/upgrade_copper.png" id="11_lt33g"] [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://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="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://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"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_rh35r"]
size = Vector2(240, 384) size = Vector2(240, 384)
@ -40,7 +41,6 @@ script = ExtResource("1_i3ly0")
upgrade_copper_texture = ExtResource("11_lt33g") upgrade_copper_texture = ExtResource("11_lt33g")
upgrade_silver_texture = ExtResource("3_8wvr1") upgrade_silver_texture = ExtResource("3_8wvr1")
upgrade_gold_texture = ExtResource("4_i557v") upgrade_gold_texture = ExtResource("4_i557v")
upgrade_gem_texture = ExtResource("5_wbw72")
[node name="GravityFromGyro" parent="." instance=ExtResource("2_h2pfr")] [node name="GravityFromGyro" parent="." instance=ExtResource("2_h2pfr")]
@ -66,6 +66,7 @@ debug_color = Color(0, 0.6, 0.701961, 0)
[node name="TimeSpawner" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_qwsty")] [node name="TimeSpawner" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_qwsty")]
position = Vector2(136, 0) position = Vector2(136, 0)
scene = ExtResource("13_8ux81")
target = NodePath("..") target = NodePath("..")
buffer_cap = 1 buffer_cap = 1
spawn_rect = Rect2(-20, 0, 40, 0) spawn_rect = Rect2(-20, 0, 40, 0)
@ -77,6 +78,7 @@ shape = SubResource("RectangleShape2D_4uksi")
debug_color = Color(0, 0.6, 0.701961, 0) debug_color = Color(0, 0.6, 0.701961, 0)
[node name="Timer" type="Timer" parent="TimeSpawner"] [node name="Timer" type="Timer" parent="TimeSpawner"]
one_shot = true
[node name="DebugSpawner" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_qwsty")] [node name="DebugSpawner" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_qwsty")]
position = Vector2(136, 0) position = Vector2(136, 0)
@ -84,7 +86,7 @@ scene = ExtResource("13_4j8om")
target = NodePath("..") target = NodePath("..")
buffer_cap = 1 buffer_cap = 1
spawn_rect = Rect2(-20, 0, 40, 0) spawn_rect = Rect2(-20, 0, 40, 0)
overlapping_body_count_limit = 16 overlapping_body_count_limit = 128
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="NeckShape" type="CollisionShape2D" parent="DebugSpawner"] [node name="NeckShape" type="CollisionShape2D" parent="DebugSpawner"]
@ -187,7 +189,15 @@ position = Vector2(405, 540)
shape = SubResource("RectangleShape2D_jed57") shape = SubResource("RectangleShape2D_jed57")
debug_color = Color(0, 0, 0, 0.419608) 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="changed" from="Bottle/Evaluator" to="." method="_on_score_changed"]
[connection signal="timeout" from="TimeSpawner/Timer" to="TimeSpawner" method="spawn"] [connection signal="timeout" from="TimeSpawner/Timer" to="TimeSpawner" method="spawn"]
[connection signal="timeout" from="DebugSpawner/DebugTimer" to="DebugSpawner" method="spawn"] [connection signal="timeout" from="DebugSpawner/DebugTimer" to="DebugSpawner" method="spawn"]
[connection signal="collected" from="StoreCollector" to="." method="_on_store_collector_collected"] [connection signal="collected" from="StoreCollector" to="." method="_on_store_collector_collected"]
[editable path="CoalDiamondConverter"]

View file

@ -54,6 +54,3 @@ func _on_shop_ui_delete_begin():
func _on_shop_ui_delete_cancel(): func _on_shop_ui_delete_cancel():
ui_state = UIState.GAME ui_state = UIState.GAME
func _on_shop_ui_purchase_cancel(_what):
ui_state = UIState.GAME