1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-21 23:34:18 +00:00
This commit is contained in:
Matteo Balugani 2023-10-02 21:29:05 +02:00
parent 0fe5c43355
commit 307f416951
8 changed files with 69 additions and 7 deletions

View file

@ -136,5 +136,6 @@ stream = ExtResource("11_r8505")
[node name="ConverterPlacementBody" parent="." instance=ExtResource("12_5qhgs")] [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="goal" from="Collector" to="." method="_on_collector_goal"]
[connection signal="timeout" from="ConversionTimer" to="." method="_on_timer_timeout"] [connection signal="timeout" from="ConversionTimer" to="." method="_on_timer_timeout"]

View file

@ -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="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"] [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="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"]
[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"] [sub_resource type="AtlasTexture" id="AtlasTexture_00uxa"]
atlas = ExtResource("3_p4wsd") atlas = ExtResource("3_p4wsd")
@ -126,6 +128,9 @@ spawn_rotation_degrees_min = 80.0
spawn_rotation_degrees_max = 100.0 spawn_rotation_degrees_max = 100.0
overlapping_body_count_limit = 4 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"] [node name="PreventSpawnShape" type="CollisionShape2D" parent="Spawner"]
z_index = 3 z_index = 3
position = Vector2(0, 3.5) position = Vector2(0, 3.5)
@ -133,7 +138,6 @@ shape = SubResource("RectangleShape2D_jeo5f")
debug_color = Color(0.701961, 0, 0, 0.419608) debug_color = Color(0.701961, 0, 0, 0.419608)
[node name="ConversionTimer" type="Timer" parent="."] [node name="ConversionTimer" type="Timer" parent="."]
wait_time = 0.5
one_shot = true one_shot = true
[node name="SoundWorking" type="AudioStreamPlayer" parent="."] [node name="SoundWorking" type="AudioStreamPlayer" parent="."]
@ -142,6 +146,10 @@ stream = ExtResource("10_hy4ck")
[node name="SoundComplete" type="AudioStreamPlayer" parent="."] [node name="SoundComplete" type="AudioStreamPlayer" parent="."]
stream = ExtResource("11_5c46k") 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")] [node name="ConverterPlacementBody" parent="." instance=ExtResource("12_xld3l")]
[connection signal="collected" from="Collector" to="." method="_on_collector_collected" flags=18] [connection signal="collected" from="Collector" to="." method="_on_collector_collected" flags=18]

34
entity/coal.png.import Normal file
View file

@ -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

View file

@ -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="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://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="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"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_c6byl"]
size = Vector2(14, 3) size = Vector2(14, 3)
@ -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

@ -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="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"]
@ -16,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)
@ -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")] [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)
@ -75,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)
@ -82,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"]
@ -185,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

@ -6,7 +6,7 @@
[ext_resource type="PackedScene" uid="uid://cklkdygv61bny" path="res://interface/shop_ui.tscn" id="2_qj86l"] [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="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://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"] [ext_resource type="Script" path="res://game_camera.gd" id="5_xxjtg"]
[sub_resource type="GDScript" id="GDScript_kyj65"] [sub_resource type="GDScript" id="GDScript_kyj65"]

View file

@ -54,6 +54,10 @@ func _do_spawn():
return return
if scene == null: if scene == null:
return return
if scene._bundled["names"][0]=="Coal":
var scene = PackedScene.new()
scene.pack(get_node("Diamond"))
print("ehi")
var instantiated = scene.instantiate() var instantiated = scene.instantiate()
instantiated.global_position = global_position + _select_spawn_position() instantiated.global_position = global_position + _select_spawn_position()
instantiated.rotation_degrees = _select_spawn_rotation() instantiated.rotation_degrees = _select_spawn_rotation()