1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-22 07:44:17 +00:00
This commit is contained in:
Matteo Balugani 2023-10-02 00:27:14 +02:00
commit 62190f1b18
13 changed files with 62 additions and 32 deletions

View file

@ -15,11 +15,4 @@ sources/0 = SubResource("TileSetAtlasSource_midqx")
tile_set = SubResource("TileSet_tr7be") tile_set = SubResource("TileSet_tr7be")
collision_visibility_mode = 1 collision_visibility_mode = 1
format = 2 format = 2
layer_0/tile_data = PackedInt32Array(-1638406, 0, 0, -1638407, 0, 0, -1638408, 0, 0, -1572872, 0, 0, -1507336, 0, 0, -1441800, 0, 0, -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, -1507321, 0, 0, -1376249, 0, 0, -1310713, 0, 0, -1245177, 0, 0, -1179641, 0, 0, -1572857, 0, 0, -1638393, 0, 0, -1703929, 0, 0, -1703930, 0, 0, -1703931, 0, 0, -1638405, 0, 0, -1638404, 0, 0, -1703940, 0, 0, -1769476, 0, 0, -1835012, 0, 0, -1900548, 0, 0, -1703932, 0, 0, -1703933, 0, 0, -1769469, 0, 0, -1835005, 0, 0, -1900541, 0, 0, -1966077, 0, 0) 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, -400, 112, -400, 112, -16, -112, -16, -112, -400, -48, -400, -48, -576)

View file

@ -2,7 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://qy1fubii8tqi" uid="uid://dxtstvjlten8p"
path="res://.godot/imported/coin_gold.png-0c230a4cf47b2f846ae95a49942eff1e.ctex" path="res://.godot/imported/coin_gold.png-0c230a4cf47b2f846ae95a49942eff1e.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false

View file

@ -2,7 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://blfyda7vw3q3h" uid="uid://bwqsdmghnrmhy"
path="res://.godot/imported/coin_gold_outline.png-a9a15b5756ee7fa7d320f210be0aa93e.ctex" path="res://.godot/imported/coin_gold_outline.png-a9a15b5756ee7fa7d320f210be0aa93e.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false

BIN
entity/glass_tileset.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

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

View file

@ -2,7 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://dky53nnnsqrf3" uid="uid://c1fu70mb51gyd"
path="res://.godot/imported/silver_converter_back.png-04ef08ef1c6ba3a7ef842e74e84ab87a.ctex" path="res://.godot/imported/silver_converter_back.png-04ef08ef1c6ba3a7ef842e74e84ab87a.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false

View file

@ -2,7 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://5320c0lts3sb" uid="uid://d3xa3cqu73xjd"
path="res://.godot/imported/silver_converter_front_1.png-ef096085a3520f98616dff5262520f12.ctex" path="res://.godot/imported/silver_converter_front_1.png-ef096085a3520f98616dff5262520f12.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false

View file

@ -2,7 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://xocipqvibphg" uid="uid://cwycuwkppcjfu"
path="res://.godot/imported/silver_converter_front_2.png-04833d844d5196d082aa61a07f77cad8.ctex" path="res://.godot/imported/silver_converter_front_2.png-04833d844d5196d082aa61a07f77cad8.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false

View file

@ -2,7 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://c7lgajcnb0hxs" uid="uid://b006dig4oebpl"
path="res://.godot/imported/silver_converter_front_3.png-ba3e375be79147732d0a2cccd2e35d9d.ctex" path="res://.godot/imported/silver_converter_front_3.png-ba3e375be79147732d0a2cccd2e35d9d.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false

View file

@ -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="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"]
[ext_resource type="PackedScene" uid="uid://d05b8jy3xmpcb" path="res://bottle/gravity_from_gyro.tscn" id="2_h2pfr"] [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://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://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"] [node name="Game" type="Node2D"]
texture_filter = 1 texture_filter = 1
@ -20,8 +19,9 @@ z_index = 10
position = Vector2(3, -298) position = Vector2(3, -298)
[node name="TimeSpawner" parent="." instance=ExtResource("3_qwsty")] [node name="TimeSpawner" parent="." instance=ExtResource("3_qwsty")]
position = Vector2(0, -480) position = Vector2(0, -144)
scene = ExtResource("4_e5nwi") scene = ExtResource("4_e5nwi")
target = NodePath("..")
buffer_cap = 1 buffer_cap = 1
spawn_position_range_x = 32.0 spawn_position_range_x = 32.0
spawn_rotation_range = 15.0 spawn_rotation_range = 15.0
@ -29,10 +29,13 @@ overlapping_bodies_collision_mask = 4
overlapping_body_count_limit = 4 overlapping_body_count_limit = 4
[node name="Timer" type="Timer" parent="TimeSpawner"] [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, -480) position = Vector2(0, -144)
scene = ExtResource("4_e5nwi") scene = ExtResource("4_e5nwi")
target = NodePath("..")
buffer_cap = 50 buffer_cap = 50
spawn_position_range_x = 32.0 spawn_position_range_x = 32.0
spawn_rotation_range = 15.0 spawn_rotation_range = 15.0

View file

@ -3,7 +3,6 @@ class_name Root
@onready var tree: SceneTree = get_tree() @onready var tree: SceneTree = get_tree()
@onready var game: Game = $UI/GameContainer/Game
@onready var game_ui: GameUI = $UI/GameUI @onready var game_ui: GameUI = $UI/GameUI
@onready var shop_ui: ShopUI = $UI/ShopUI @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(): func _on_game_ui_shop_button_pressed():
ui_state = UIState.SHOP ui_state = UIState.SHOP
func _on_game_ui_spawn_button_pressed():
game.trigger_spawn()
func _on_shop_ui_purchase_begin(_what): func _on_shop_ui_purchase_begin(_what):
ui_state = UIState.GAME ui_state = UIState.GAME

View file

@ -42,10 +42,10 @@ process_mode = 3
visible = false visible = false
layout_mode = 1 layout_mode = 1
[connection signal="score_button_pressed" from="UI/GameUI" to="." method="_on_game_ui_score_button_pressed"] [connection signal="score_button_pressed" from="View/SafeUI/GameUI" to="." method="_on_game_ui_score_button_pressed"]
[connection signal="shop_button_pressed" from="UI/GameUI" to="." method="_on_game_ui_shop_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="UI/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="UI/ShopUI" to="." method="_on_shop_ui_back_button_pressed"] [connection signal="back_button_pressed" from="View/SafeUI/ShopUI" to="." method="_on_shop_ui_back_button_pressed"]
[connection signal="delete_button_pressed" from="UI/ShopUI" to="." method="_on_shop_ui_delete_button_pressed"] [connection signal="delete_button_pressed" from="View/SafeUI/ShopUI" to="." method="_on_shop_ui_delete_button_pressed"]
[connection signal="purchase_begin" from="UI/ShopUI" to="." method="_on_shop_ui_purchase_begin"] [connection signal="purchase_begin" from="View/SafeUI/ShopUI" to="." method="_on_shop_ui_purchase_begin"]
[connection signal="score_button_pressed" from="UI/ShopUI" to="." method="_on_shop_ui_score_button_pressed"] [connection signal="score_button_pressed" from="View/SafeUI/ShopUI" to="." method="_on_shop_ui_score_button_pressed"]

View file

@ -3,6 +3,7 @@ class_name Spawner
@export var scene: PackedScene @export var scene: PackedScene
@export var target: Node
var buffer: int = 0 var buffer: int = 0
@export var buffer_cap: int @export var buffer_cap: int
@ -43,9 +44,9 @@ func _do_spawn():
if _count_overlapping_bodies() > overlapping_body_count_limit: if _count_overlapping_bodies() > overlapping_body_count_limit:
return return
var scene_instant = scene.instantiate() 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() scene_instant.rotation_degrees = _select_spawn_rotation()
add_child(scene_instant) target.add_child(scene_instant)
emit_signal("spawned", scene_instant) emit_signal("spawned", scene_instant)
buffer -= 1 buffer -= 1