diff --git a/Assets/Textures/Opera_senza_titolo (1).png b/Assets/Textures/Opera_senza_titolo (1).png new file mode 100644 index 0000000..807868f Binary files /dev/null and b/Assets/Textures/Opera_senza_titolo (1).png differ diff --git a/Assets/Textures/Opera_senza_titolo (1).png.import b/Assets/Textures/Opera_senza_titolo (1).png.import new file mode 100644 index 0000000..c38ad5a --- /dev/null +++ b/Assets/Textures/Opera_senza_titolo (1).png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://biyvvql2ufkdf" +path.s3tc="res://.godot/imported/Opera_senza_titolo (1).png-25dbee0de56c7859add7106467c21436.s3tc.ctex" +path.etc2="res://.godot/imported/Opera_senza_titolo (1).png-25dbee0de56c7859add7106467c21436.etc2.ctex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://Assets/Textures/Opera_senza_titolo (1).png" +dest_files=["res://.godot/imported/Opera_senza_titolo (1).png-25dbee0de56c7859add7106467c21436.s3tc.ctex", "res://.godot/imported/Opera_senza_titolo (1).png-25dbee0de56c7859add7106467c21436.etc2.ctex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +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=0 diff --git a/Assets/Textures/Opera_senza_titolo (2).png b/Assets/Textures/Opera_senza_titolo (2).png new file mode 100644 index 0000000..ecd32a5 Binary files /dev/null and b/Assets/Textures/Opera_senza_titolo (2).png differ diff --git a/Assets/Textures/Opera_senza_titolo (2).png.import b/Assets/Textures/Opera_senza_titolo (2).png.import new file mode 100644 index 0000000..b8c3cf9 --- /dev/null +++ b/Assets/Textures/Opera_senza_titolo (2).png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bhmyyu0uhx541" +path.s3tc="res://.godot/imported/Opera_senza_titolo (2).png-18daf683486c3c1f1928755a41dbce09.s3tc.ctex" +path.etc2="res://.godot/imported/Opera_senza_titolo (2).png-18daf683486c3c1f1928755a41dbce09.etc2.ctex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://Assets/Textures/Opera_senza_titolo (2).png" +dest_files=["res://.godot/imported/Opera_senza_titolo (2).png-18daf683486c3c1f1928755a41dbce09.s3tc.ctex", "res://.godot/imported/Opera_senza_titolo (2).png-18daf683486c3c1f1928755a41dbce09.etc2.ctex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +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=0 diff --git a/Assets/Textures/Opera_senza_titolo.png b/Assets/Textures/Opera_senza_titolo.png new file mode 100644 index 0000000..dbaabc4 Binary files /dev/null and b/Assets/Textures/Opera_senza_titolo.png differ diff --git a/Assets/Textures/Opera_senza_titolo.png.import b/Assets/Textures/Opera_senza_titolo.png.import new file mode 100644 index 0000000..6c5ed9c --- /dev/null +++ b/Assets/Textures/Opera_senza_titolo.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cet5o7wla1x7t" +path.s3tc="res://.godot/imported/Opera_senza_titolo.png-b572925c3cfbdcda723be9c32de6e84b.s3tc.ctex" +path.etc2="res://.godot/imported/Opera_senza_titolo.png-b572925c3cfbdcda723be9c32de6e84b.etc2.ctex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://Assets/Textures/Opera_senza_titolo.png" +dest_files=["res://.godot/imported/Opera_senza_titolo.png-b572925c3cfbdcda723be9c32de6e84b.s3tc.ctex", "res://.godot/imported/Opera_senza_titolo.png-b572925c3cfbdcda723be9c32de6e84b.etc2.ctex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +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=0 diff --git a/Nodes/Player.tscn b/Nodes/Player.tscn index 6a99028..4d29902 100644 --- a/Nodes/Player.tscn +++ b/Nodes/Player.tscn @@ -10,6 +10,7 @@ radius = 0.808068 [node name="CharacterBody3D" type="CharacterBody3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0) +collision_mask = 3 script = ExtResource("1_dta8q") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] diff --git a/Nodes/Train_P1_2.tscn b/Nodes/Train_P1_2.tscn new file mode 100644 index 0000000..6d54cf4 --- /dev/null +++ b/Nodes/Train_P1_2.tscn @@ -0,0 +1,125 @@ +[gd_scene load_steps=20 format=3 uid="uid://c3p3k8ytvc32e"] + +[ext_resource type="Script" path="res://scripts/Train.gd" id="1_hg4dh"] +[ext_resource type="PackedScene" uid="uid://vwjd5od63jgh" path="res://Nodes/Player.tscn" id="2_0fjcv"] +[ext_resource type="Texture2D" uid="uid://dsphpbpt27t1i" path="res://a3TCqhg.png" id="3_jfnq6"] +[ext_resource type="Texture2D" uid="uid://d1m2jplf8u0h0" path="res://Nodes/walking_ball1.png" id="4_felkj"] +[ext_resource type="Texture2D" uid="uid://b5hai0ap763xu" path="res://walking_coal1.png" id="5_t3pnu"] +[ext_resource type="Texture2D" uid="uid://d35iaj0nq122a" path="res://walking_powder1.png" id="6_0vuit"] +[ext_resource type="Texture2D" uid="uid://eg0k8esm2scp" path="res://p5lFkJY.png" id="7_37us6"] +[ext_resource type="Texture2D" uid="uid://du7d6fk4dabd7" path="res://cVOQuID.png" id="8_uawfa"] +[ext_resource type="Texture2D" uid="uid://ctbxpx6p36bdi" path="res://walking_ball2.png" id="9_ssjd8"] +[ext_resource type="Texture2D" uid="uid://b5ioch3ad8y6r" path="res://walking_coal2.png" id="10_y3g4p"] +[ext_resource type="Texture2D" uid="uid://ckdlv6b7okseq" path="res://walking_powder2.png" id="11_h0rqm"] +[ext_resource type="Texture2D" uid="uid://7qppu15lvd1j" path="res://Nodes/Keys.png" id="12_287nh"] +[ext_resource type="PackedScene" uid="uid://cet80w4yr8rse" path="res://Storage.tscn" id="13_3fxhr"] +[ext_resource type="PackedScene" uid="uid://byo1m0n20yl45" path="res://Nodes/cannon.tscn" id="14_3pfub"] +[ext_resource type="PackedScene" uid="uid://bhivunrkj87cy" path="res://Nodes/engine.tscn" id="15_4kp3s"] +[ext_resource type="PackedScene" uid="uid://bkpnrgcfr1jgl" path="res://Nodes/Bin.tscn" id="16_ep4dv"] +[ext_resource type="AudioStream" uid="uid://b52sd64x20ulv" path="res://Assets/Sounds/_SOUNDFX_/Gunpowder.wav" id="17_06sqf"] +[ext_resource type="PackedScene" uid="uid://c1mymb38wqdg6" path="res://Nodes/train.tscn" id="18_6adfq"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_6p0y6"] +animations = [{ +"frames": [ExtResource("3_jfnq6")], +"loop": true, +"name": &"idle", +"speed": 1.0 +}, { +"frames": [ExtResource("4_felkj")], +"loop": true, +"name": &"idle_ball", +"speed": 1.0 +}, { +"frames": [ExtResource("5_t3pnu")], +"loop": true, +"name": &"idle_coal", +"speed": 1.0 +}, { +"frames": [ExtResource("6_0vuit")], +"loop": true, +"name": &"idle_powder", +"speed": 1.0 +}, { +"frames": [ExtResource("7_37us6"), ExtResource("8_uawfa")], +"loop": true, +"name": &"walking", +"speed": 2.0 +}, { +"frames": [ExtResource("4_felkj"), ExtResource("9_ssjd8")], +"loop": true, +"name": &"walking_ball", +"speed": 2.0 +}, { +"frames": [ExtResource("5_t3pnu"), ExtResource("10_y3g4p")], +"loop": true, +"name": &"walking_coal", +"speed": 2.0 +}, { +"frames": [ExtResource("6_0vuit"), ExtResource("11_h0rqm")], +"loop": true, +"name": &"walking_powder", +"speed": 2.0 +}] + +[node name="Train1" type="Node3D"] +transform = Transform3D(1, 0, 3.55271e-15, 0, 1, 0, -3.55271e-15, 0, 1, 0, 0, 0) +script = ExtResource("1_hg4dh") + +[node name="CharacterBody3D" parent="." instance=ExtResource("2_0fjcv")] +transform = Transform3D(1, 0, -3.55271e-15, 0, 1, 0, 3.55271e-15, 0, 1, 3.19744e-14, 3, -9) + +[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="CharacterBody3D"] +transform = Transform3D(0.3, 0, 0, 0, -1.31134e-08, 0.3, 0, -0.3, -1.31134e-08, 0, -2, 0) +frames = SubResource("SpriteFrames_6p0y6") +animation = &"walking_coal" +speed_scale = 2.0 +playing = true + +[node name="MiniGameButton0" type="Sprite3D" parent="CharacterBody3D"] +transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 0, 6, 0) +texture = ExtResource("12_287nh") +hframes = 5 +vframes = 8 +frame = 26 + +[node name="MiniGameButton1" type="Sprite3D" parent="CharacterBody3D"] +transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 1.5, 6, 0) +texture = ExtResource("12_287nh") +hframes = 5 +vframes = 8 +frame = 26 + +[node name="MiniGameButton2" type="Sprite3D" parent="CharacterBody3D"] +transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 3, 6, 0) +texture = ExtResource("12_287nh") +hframes = 5 +vframes = 8 +frame = 26 + +[node name="Storage" parent="." instance=ExtResource("13_3fxhr")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.31598, 0.0193453, -5.2771) + +[node name="Storage2" parent="." instance=ExtResource("13_3fxhr")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.31598, 0.0193453, 0.876562) +currentType = 2 + +[node name="Cannon" parent="." instance=ExtResource("14_3pfub")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.32927, 1.2303, 0.0486939) + +[node name="Cannon2" parent="." instance=ExtResource("14_3pfub")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.38381, 1.2303, 5.95106) + +[node name="Engine" parent="." instance=ExtResource("15_4kp3s")] +transform = Transform3D(-6.55671e-08, 0, 1.5, 0, 1.5, 0, -1.5, 0, -6.55671e-08, -3.45639, 1.1688, 9) + +[node name="Bin" parent="." instance=ExtResource("16_ep4dv")] +transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.70291, -0.287106, 10.1948) + +[node name="Storage3" parent="." instance=ExtResource("13_3fxhr")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.63306, -0.501894, -11.5457) +currentType = 1 +audioClip = ExtResource("17_06sqf") + +[node name="train" parent="." instance=ExtResource("18_6adfq")] +transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0) diff --git a/Nodes/Train_P2_2.tscn b/Nodes/Train_P2_2.tscn new file mode 100644 index 0000000..d36670e --- /dev/null +++ b/Nodes/Train_P2_2.tscn @@ -0,0 +1,165 @@ +[gd_scene load_steps=25 format=3 uid="uid://cq6vbhvrpqkiy"] + +[ext_resource type="Script" path="res://scripts/Train.gd" id="1_hjs75"] +[ext_resource type="PackedScene" uid="uid://c1mymb38wqdg6" path="res://Nodes/train.tscn" id="2_jaa8m"] +[ext_resource type="PackedScene" uid="uid://vwjd5od63jgh" path="res://Nodes/Player.tscn" id="3_mmqok"] +[ext_resource type="Texture2D" uid="uid://cxfybbp5idjwg" path="res://o_idle1.png" id="4_tox2m"] +[ext_resource type="Texture2D" uid="uid://dh6hvv1lfdnm1" path="res://o_idle2.png" id="5_jipmo"] +[ext_resource type="Texture2D" uid="uid://c1v5tc8lk8pdo" path="res://o_walking_ball1.png" id="6_ndwd0"] +[ext_resource type="Texture2D" uid="uid://ci4yd4vjr17o1" path="res://o_walking_coal1.png" id="7_ehq5f"] +[ext_resource type="Texture2D" uid="uid://os0kogn0mkus" path="res://o_walking_powder1.png" id="8_scx2e"] +[ext_resource type="Texture2D" uid="uid://bjrhp4dqckoxf" path="res://o_walking1.png" id="9_c8uyv"] +[ext_resource type="Texture2D" uid="uid://j7jwtqmvg0m8" path="res://o_walking2.png" id="10_eceo1"] +[ext_resource type="Texture2D" uid="uid://djsergj3l4t2c" path="res://o_walking_ball2.png" id="11_ryiak"] +[ext_resource type="Texture2D" uid="uid://nctqw3vt5q0y" path="res://o_walking_coal2.png" id="12_w8c3m"] +[ext_resource type="Texture2D" uid="uid://ctssikrodjqvc" path="res://o_walking_powder2.png" id="13_vxnkq"] +[ext_resource type="Texture2D" uid="uid://7qppu15lvd1j" path="res://Nodes/Keys.png" id="14_xklxf"] +[ext_resource type="PackedScene" uid="uid://bkpnrgcfr1jgl" path="res://Nodes/Bin.tscn" id="15_q7blv"] +[ext_resource type="PackedScene" uid="uid://byo1m0n20yl45" path="res://Nodes/cannon.tscn" id="16_bmbr8"] +[ext_resource type="PackedScene" uid="uid://cet80w4yr8rse" path="res://Storage.tscn" id="17_rdygb"] +[ext_resource type="AudioStream" uid="uid://b52sd64x20ulv" path="res://Assets/Sounds/_SOUNDFX_/Gunpowder.wav" id="18_skoud"] +[ext_resource type="PackedScene" uid="uid://bhivunrkj87cy" path="res://Nodes/engine.tscn" id="19_ubtn3"] + +[sub_resource type="BoxShape3D" id="BoxShape3D_dijw3"] +size = Vector3(1, 3.77669, 24) + +[sub_resource type="BoxShape3D" id="BoxShape3D_ao4pd"] +size = Vector3(12, 1, 24) + +[sub_resource type="BoxShape3D" id="BoxShape3D_g76js"] +size = Vector3(12, 4, 1) + +[sub_resource type="BoxShape3D" id="BoxShape3D_psmwd"] +size = Vector3(1, 6, 9.05915) + +[sub_resource type="SpriteFrames" id="SpriteFrames_ltjyh"] +animations = [{ +"frames": [ExtResource("4_tox2m"), ExtResource("5_jipmo")], +"loop": true, +"name": &"idle", +"speed": 2.0 +}, { +"frames": [ExtResource("6_ndwd0")], +"loop": true, +"name": &"idle_ball", +"speed": 1.0 +}, { +"frames": [ExtResource("7_ehq5f")], +"loop": true, +"name": &"idle_coal", +"speed": 1.0 +}, { +"frames": [ExtResource("8_scx2e")], +"loop": true, +"name": &"idle_powder", +"speed": 1.0 +}, { +"frames": [ExtResource("9_c8uyv"), ExtResource("10_eceo1")], +"loop": true, +"name": &"walking", +"speed": 2.0 +}, { +"frames": [ExtResource("6_ndwd0"), ExtResource("11_ryiak")], +"loop": true, +"name": &"walking_ball", +"speed": 2.0 +}, { +"frames": [ExtResource("7_ehq5f"), ExtResource("12_w8c3m")], +"loop": true, +"name": &"walking_coal", +"speed": 2.0 +}, { +"frames": [ExtResource("8_scx2e"), ExtResource("13_vxnkq")], +"loop": true, +"name": &"walking_powder", +"speed": 2.0 +}] + +[node name="Train2" type="Node3D"] +transform = Transform3D(1, 0, 3.55271e-15, 0, 1, 0, -3.55271e-15, 0, 1, 0, 0, 0) +script = ExtResource("1_hjs75") + +[node name="train" parent="." instance=ExtResource("2_jaa8m")] +transform = Transform3D(1.96701e-07, 0, -1.5, 0, 1.5, 0, 1.5, 0, 1.96701e-07, -3, 0, -9) + +[node name="StaticBody3D2" type="StaticBody3D" parent="train"] +transform = Transform3D(-2.91409e-08, 0, -0.666667, 0, 0.666667, 0, 0.666667, 0, -2.91409e-08, 6, -0.137826, -1.33333) + +[node name="CollisionShape3D2" type="CollisionShape3D" parent="train/StaticBody3D2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.5, 2, 4.23516e-22) +shape = SubResource("BoxShape3D_dijw3") + +[node name="CollisionShape3D3" type="CollisionShape3D" parent="train/StaticBody3D2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.5, 2, 3.55271e-15) +shape = SubResource("BoxShape3D_dijw3") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="train/StaticBody3D2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -3.55271e-15) +shape = SubResource("BoxShape3D_ao4pd") + +[node name="CollisionShape3D4" type="CollisionShape3D" parent="train/StaticBody3D2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 2, -12) +shape = SubResource("BoxShape3D_g76js") + +[node name="CollisionShape3D5" type="CollisionShape3D" parent="train/StaticBody3D2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 2, 12) +shape = SubResource("BoxShape3D_g76js") + +[node name="CollisionShape3D6" type="CollisionShape3D" parent="train/StaticBody3D2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 3, -1.52864) +shape = SubResource("BoxShape3D_psmwd") + +[node name="CharacterBody3D" parent="." instance=ExtResource("3_mmqok")] +transform = Transform3D(1, 0, -3.55271e-15, 0, 1, 0, 3.55271e-15, 0, 1, 2.84217e-14, 3, -8) + +[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="CharacterBody3D"] +transform = Transform3D(0.3, 0, 0, 0, -1.31134e-08, 0.3, 0, -0.3, -1.31134e-08, 0, -2, 0) +frames = SubResource("SpriteFrames_ltjyh") +animation = &"walking_coal" +speed_scale = 2.0 +playing = true + +[node name="MiniGameButton0" type="Sprite3D" parent="CharacterBody3D"] +transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 0, 6, 0) +texture = ExtResource("14_xklxf") +hframes = 5 +vframes = 8 +frame = 26 + +[node name="MiniGameButton1" type="Sprite3D" parent="CharacterBody3D"] +transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 1.5, 6, 0) +texture = ExtResource("14_xklxf") +hframes = 5 +vframes = 8 +frame = 26 + +[node name="MiniGameButton2" type="Sprite3D" parent="CharacterBody3D"] +transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 3, 6, 0) +texture = ExtResource("14_xklxf") +hframes = 5 +vframes = 8 +frame = 26 + +[node name="Bin" parent="." instance=ExtResource("15_q7blv")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.18577, 0.622175, 10.6544) + +[node name="Cannon" parent="." instance=ExtResource("16_bmbr8")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.90697, 1.80346, 0.245877) + +[node name="Cannon2" parent="." instance=ExtResource("16_bmbr8")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.90697, 1.80346, -5.83086) + +[node name="Storage" parent="." instance=ExtResource("17_rdygb")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.30738, 0.293261, -10.1586) + +[node name="Storage2" parent="." instance=ExtResource("17_rdygb")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.67656, 0.293261, -1.79235) +currentType = 1 + +[node name="Storage3" parent="." instance=ExtResource("17_rdygb")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.79878, 0.293261, 6.13508) +currentType = 2 +audioClip = ExtResource("18_skoud") + +[node name="Engine" parent="." instance=ExtResource("19_ubtn3")] +transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 2.86451, 1.17834, 10.1923) diff --git a/Nodes/game.tscn b/Nodes/game.tscn index aeb5d02..19a7a32 100644 --- a/Nodes/game.tscn +++ b/Nodes/game.tscn @@ -1,7 +1,7 @@ -[gd_scene load_steps=10 format=3 uid="uid://cqkd0g15r5btu"] +[gd_scene load_steps=10 format=3 uid="uid://db0pxwq1hvs45"] [ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_gf730"] -[ext_resource type="PackedScene" path="res://Nodes/light_setup.tscn" id="2_8im8o"] +[ext_resource type="PackedScene" uid="uid://nxapkgcq2c70" path="res://Nodes/light_setup.tscn" id="2_8im8o"] [ext_resource type="PackedScene" uid="uid://bqe8ucbruto1j" path="res://Nodes/StartNode.tscn" id="3_s558u"] [ext_resource type="PackedScene" uid="uid://md2ofbviios3" path="res://Nodes/Train_P1.tscn" id="4_05mbx"] [ext_resource type="PackedScene" uid="uid://bikdn7ep2vpxw" path="res://Nodes/Train_P2.tscn" id="5_gee2r"] diff --git a/Nodes/game2.tscn b/Nodes/game2.tscn new file mode 100644 index 0000000..3f18caf --- /dev/null +++ b/Nodes/game2.tscn @@ -0,0 +1,52 @@ +[gd_scene load_steps=10 format=3 uid="uid://dyw054t0rhigr"] + +[ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_gf730"] +[ext_resource type="PackedScene" path="res://Nodes/light_setup.tscn" id="2_8im8o"] +[ext_resource type="PackedScene" uid="uid://bqe8ucbruto1j" path="res://Nodes/StartNode.tscn" id="3_s558u"] +[ext_resource type="PackedScene" uid="uid://md2ofbviios3" path="res://Nodes/Train_P1.tscn" id="4_05mbx"] +[ext_resource type="PackedScene" uid="uid://bikdn7ep2vpxw" path="res://Nodes/Train_P2.tscn" id="5_gee2r"] +[ext_resource type="PackedScene" uid="uid://cys06pnxfjl2m" path="res://Nodes/UI.tscn" id="6_l0q7q"] +[ext_resource type="AudioStream" uid="uid://c5jhukuk8r3mf" path="res://Assets/Sounds/_MUSIC_/GameJamGameLoop.wav" id="7_0xbd4"] +[ext_resource type="AudioStream" uid="uid://n4ynf7hg2pcl" path="res://Assets/Sounds/_SOUNDFX_/GleiseLoop.wav" id="8_1d2gk"] +[ext_resource type="AudioStream" uid="uid://dovvnflvxtqpi" path="res://Assets/Sounds/_SOUNDFX_/WindLoop.wav" id="9_8qwj6"] + +[node name="Game" type="Node"] +script = ExtResource("1_gf730") + +[node name="LightSetup" parent="." instance=ExtResource("2_8im8o")] + +[node name="StartNode" parent="." instance=ExtResource("3_s558u")] + +[node name="Camera3D" type="Camera3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 43, 26.0132) +current = true +fov = 30.0 +size = 32.0 +near = 0.041 + +[node name="Train1" parent="." instance=ExtResource("4_05mbx")] +transform = Transform3D(1, 0, 3.55271e-15, 0, 1, 0, -3.55271e-15, 0, 1, -10, 0, 0) + +[node name="Train2" parent="." instance=ExtResource("5_gee2r")] +transform = Transform3D(1, 0, 3.55271e-15, 0, 1, 0, -3.55271e-15, 0, 1, 9.90113, -0.0549407, -0.085681) + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] +transform = Transform3D(0.875944, -0.294781, 0.381872, -0.106805, 0.65344, 0.749406, -0.470441, -0.697224, 0.540892, 0, 8.25958, 0) +visible = false + +[node name="Control" parent="." instance=ExtResource("6_l0q7q")] + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("7_0xbd4") +volume_db = -27.238 +autoplay = true + +[node name="AudioStreamPlayer2" type="AudioStreamPlayer" parent="."] +stream = ExtResource("8_1d2gk") +volume_db = -10.0 +autoplay = true + +[node name="AudioStreamPlayer3" type="AudioStreamPlayer" parent="."] +stream = ExtResource("9_8qwj6") +volume_db = -2.476 +autoplay = true diff --git a/Storage.tscn b/Storage.tscn index 6fb1e2a..66a5103 100644 --- a/Storage.tscn +++ b/Storage.tscn @@ -1,13 +1,18 @@ -[gd_scene load_steps=4 format=3 uid="uid://cet80w4yr8rse"] +[gd_scene load_steps=6 format=3 uid="uid://cet80w4yr8rse"] [ext_resource type="Script" path="res://scripts/Modules/Storage.gd" id="1_guwoh"] [ext_resource type="Texture2D" uid="uid://cjc4wohtjb73j" path="res://Chest.png" id="2_a5kei"] +[ext_resource type="Texture2D" uid="uid://cet5o7wla1x7t" path="res://Assets/Textures/Opera_senza_titolo.png" id="3_ojyse"] [sub_resource type="CylinderShape3D" id="CylinderShape3D_c1ipa"] height = 3.60519 radius = 1.33696 +[sub_resource type="CylinderShape3D" id="CylinderShape3D_orr2n"] +radius = 3.22778 + [node name="Storage" type="StaticBody3D"] +collision_layer = 2 script = ExtResource("1_guwoh") currentType = 0 @@ -20,3 +25,16 @@ transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 2, texture = ExtResource("2_a5kei") [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] + +[node name="Area3D" type="Area3D" parent="."] + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"] +shape = SubResource("CylinderShape3D_orr2n") + +[node name="Sprite3D2" type="Sprite3D" parent="."] +transform = Transform3D(0.15, 0, 0, 0, -6.55671e-09, 0.15, 0, -0.15, -6.55671e-09, 0, 3.10039, 0) +visible = false +texture = ExtResource("3_ojyse") + +[connection signal="body_entered" from="Area3D" to="." method="on_Player_enter"] +[connection signal="body_exited" from="Area3D" to="." method="on_Player_exit"] diff --git a/o_walking_large1.png b/o_walking_large1.png index 1b41d1e..347cea6 100644 Binary files a/o_walking_large1.png and b/o_walking_large1.png differ diff --git a/o_walking_large2.png b/o_walking_large2.png index 54b9add..bd8f184 100644 Binary files a/o_walking_large2.png and b/o_walking_large2.png differ diff --git a/project.godot b/project.godot index 4ef7386..30b5e90 100644 --- a/project.godot +++ b/project.godot @@ -34,6 +34,11 @@ _global_script_classes=[{ "language": &"GDScript", "path": "res://scripts/Modules/Module.gd" }, { +"base": "CharacterBody3D", +"class": &"Player", +"language": &"GDScript", +"path": "res://scripts/Player.gd" +}, { "base": "Module", "class": &"Storage", "language": &"GDScript", @@ -65,6 +70,7 @@ _global_script_class_icons={ "Game": "", "MapNode": "", "Module": "", +"Player": "", "Storage": "", "StraightMapNode": "", "Train": "", diff --git a/scripts/Modules/Cannon.gd b/scripts/Modules/Cannon.gd index b090023..82247dc 100644 --- a/scripts/Modules/Cannon.gd +++ b/scripts/Modules/Cannon.gd @@ -7,6 +7,7 @@ var currentPowderStashValue = 0 var maxPowderStashValue = 3 var CAN_ENGAGE = false var DAMAGE = 5 +var ammoType = -1 @onready var train = get_parent() as Train #------------Methods-------------# @@ -20,6 +21,7 @@ func interact(player): if player.getResource() == 0: if currentStashValue < maxStashValue: currentStashValue += 1 + ammoType = 0 player.clearInventory() $AudioStreamPlayer2.play() return @@ -30,10 +32,41 @@ func interact(player): player.clearInventory() $AudioStreamPlayer2.play() return - return + + if player.getResource() == 3: + if currentStashValue < maxStashValue: + currentStashValue += 1 + ammoType = 1 + player.clearInventory() + $AudioStreamPlayer2.play() + return + + if player.getResource() == 4: + if currentStashValue < maxStashValue: + currentStashValue += 1 + ammoType = 2 + player.clearInventory() + $AudioStreamPlayer2.play() + return func shoot(): - if currentStashValue >= 1 and currentPowderStashValue >= 1 and currentState == STATE.INACTIVE: + if currentStashValue >= 1 and currentPowderStashValue >= 1 and currentState == STATE.INACTIVE and ammoType == 0: + currentState = STATE.SHOOTING + currentStashValue -= 1 + currentPowderStashValue = 0 + currentState = STATE.INACTIVE + $AudioStreamPlayer.play(0) + return true + + if currentStashValue >= 1 and currentPowderStashValue >= 2 and currentState == STATE.INACTIVE and ammoType == 1: + currentState = STATE.SHOOTING + currentStashValue -= 1 + currentPowderStashValue = 0 + currentState = STATE.INACTIVE + $AudioStreamPlayer.play(0) + return true + + if currentStashValue >= 1 and currentPowderStashValue >= 3 and currentState == STATE.INACTIVE and ammoType == 2: currentState = STATE.SHOOTING currentStashValue -= 1 currentPowderStashValue = 0 diff --git a/scripts/Modules/Storage.gd b/scripts/Modules/Storage.gd index b6acf71..147ffe7 100644 --- a/scripts/Modules/Storage.gd +++ b/scripts/Modules/Storage.gd @@ -7,7 +7,7 @@ enum TYPE {AMMO, GUNPOWDER, COAL, LARGE, GIANT} @export var currentType: TYPE - +@export var icon : Texture2D @export var audioClip : AudioStreamWAV #------------Methods-------------# func _ready(): @@ -15,6 +15,7 @@ func _ready(): #root.ammo_pickup.connect(_on_signal_storing) maxStashValue = 10 currentStashValue = 10 + $Sprite3D2.texture = icon $AudioStreamPlayer.stream = audioClip func interact(player): @@ -28,4 +29,10 @@ func _on_signal_storing(): if currentStashValue < maxStashValue: currentStashValue += 1 return - + +func on_Player_enter(blub): + var bodies = $Area3D.get_overlapping_bodies() + $Sprite3D2.visible = true + +func on_Player_exit(blub): + $Sprite3D2.visible = false diff --git a/scripts/Player.gd b/scripts/Player.gd index b8aabc2..7ff098e 100644 --- a/scripts/Player.gd +++ b/scripts/Player.gd @@ -1,5 +1,6 @@ extends CharacterBody3D +class_name Player #-----------Parameters--------------# var SPEED = 10 var movement = Vector3(0,0,0) @@ -23,65 +24,109 @@ var rng = RandomNumberGenerator.new() func _ready(): walking = "walking" idle = "idle" - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton0").hide() - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton1").hide() - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton2").hide() + $MiniGameButton0.hide() + $MiniGameButton1.hide() + $MiniGameButton2.hide() + $MiniGameButton3.hide() + $MiniGameButton4.hide() + $MiniGameButton5.hide() + #get_parent().find_child("CharacterBody3D").find_child("MiniGameButton0").hide() + #get_parent().find_child("CharacterBody3D").find_child("MiniGameButton1").hide() + #get_parent().find_child("CharacterBody3D").find_child("MiniGameButton2").hide() func miniGameColor(input: int, red: int): if(input == 0): - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton0").modulate = Color(1,1,red) + $MiniGameButton0.modulate = Color(1,1,red) if(input == 1): - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton1").modulate = Color(1,1,red) + $MiniGameButton1.modulate = Color(1,1,red) if(input == 2): - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton2").modulate = Color(1,1,red) + $MiniGameButton2.modulate = Color(1,1,red) + if(input == 3): + $MiniGameButton3.modulate = Color(1,1,red) + if(input == 4): + $MiniGameButton4.modulate = Color(1,1,red) + if(input == 5): + $MiniGameButton5.modulate = Color(1,1,red) func miniGameReset(): MiniGamePos = 0 - miniGameColor(0,1) - miniGameColor(1,1) - miniGameColor(2,1) - MiniGame[0] = rng.randi_range(0, 3) - miniGameSetArrow(0) - MiniGame[1] = rng.randi_range(0, 3) - miniGameSetArrow(1) - MiniGame[2] = rng.randi_range(0, 3) - miniGameSetArrow(2) + if(is_player1): + miniGameColor(0,1) + miniGameColor(1,1) + miniGameColor(2,1) + MiniGame[0] = rng.randi_range(0, 3) + miniGameSetArrow(0) + MiniGame[1] = rng.randi_range(0, 3) + miniGameSetArrow(1) + MiniGame[2] = rng.randi_range(0, 3) + miniGameSetArrow(2) + else: + miniGameColor(3,1) + miniGameColor(4,1) + miniGameColor(5,1) + MiniGame[0] = rng.randi_range(0, 3) + miniGameSetArrow(3) + MiniGame[1] = rng.randi_range(0, 3) + miniGameSetArrow(4) + MiniGame[2] = rng.randi_range(0, 3) + miniGameSetArrow(5) func miniGameSetArrow(buttonNr: int): if(buttonNr == 0): - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton0").frame = 26 + MiniGame[0] - #$MiniGameButton0.frame = 26 + MiniGame[0] + $MiniGameButton0.frame = 26 + MiniGame[0] if(buttonNr == 1): - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton1").frame = 26 + MiniGame[1] - #$MiniGameButton1.frame = 26 + MiniGame[1] + $MiniGameButton1.frame = 26 + MiniGame[1] if(buttonNr == 2): - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton2").frame = 26 + MiniGame[2] - #$MiniGameButton2.frame = 26 + MiniGame[2] + $MiniGameButton2.frame = 26 + MiniGame[2] + if(buttonNr == 3): + $MiniGameButton3.frame = 26 + MiniGame[0] + if(buttonNr == 4): + $MiniGameButton4.frame = 26 + MiniGame[1] + if(buttonNr == 5): + $MiniGameButton5.frame = 26 + MiniGame[2] func miniGameCheck(input : int): - if(input == MiniGame[MiniGamePos]): - miniGameColor(MiniGamePos, 0) - MiniGamePos = MiniGamePos +1 - else: - miniGameReset() - - if(MiniGamePos >= 3): - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton0").hide() - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton1").hide() - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton2").hide() - if(is_player1): - P1inMiniGame = 0 + if(is_player1): + if(input == MiniGame[MiniGamePos]): + miniGameColor(MiniGamePos, 0) + MiniGamePos = MiniGamePos +1 else: + miniGameReset() + + if(MiniGamePos >= 3): + $MiniGameButton0.hide() + $MiniGameButton1.hide() + $MiniGameButton2.hide() + P1inMiniGame = 0 + miniGameReset() + else: + if(input == MiniGame[MiniGamePos]): + miniGameColor(MiniGamePos+3, 0) + MiniGamePos = MiniGamePos +1 + else: + miniGameReset() + + if(MiniGamePos >= 3): + $MiniGameButton3.hide() + $MiniGameButton4.hide() + $MiniGameButton5.hide() P2inMiniGame = 0 - miniGameReset() - + miniGameReset() + func _process(delta): if Input.is_action_just_pressed("p1_extra"): if(P1inMiniGame == 0): P1inMiniGame = 1 - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton0").show() - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton1").show() - get_parent().find_child("CharacterBody3D").find_child("MiniGameButton2").show() + $MiniGameButton0.show() + $MiniGameButton1.show() + $MiniGameButton2.show() + + if Input.is_action_just_pressed("p2_extra"): + if(P2inMiniGame == 0): + P2inMiniGame = 1 + $MiniGameButton3.show() + $MiniGameButton4.show() + $MiniGameButton5.show() func _physics_process(delta): if(velocity.length() > 0): @@ -188,4 +233,6 @@ func clearInventory(): print("cleared") walking = "walking" idle = "idle" - + + +