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 4927bd4..5b32f24 100644 --- a/Nodes/Player.tscn +++ b/Nodes/Player.tscn @@ -11,6 +11,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/game.tscn b/Nodes/game.tscn index aeb5d02..5b87edb 100644 --- a/Nodes/game.tscn +++ b/Nodes/game.tscn @@ -1,4 +1,4 @@ -[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"] 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/project.godot b/project.godot index e27040c..71f0abe 100644 --- a/project.godot +++ b/project.godot @@ -29,11 +29,16 @@ _global_script_classes=[{ "language": &"GDScript", "path": "res://scripts/Logic/MapNode.gd" }, { -"base": "Node", +"base": "StaticBody3D", "class": &"Module", "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/Storage.gd b/scripts/Modules/Storage.gd index 92ffa01..79f97c6 100644 --- a/scripts/Modules/Storage.gd +++ b/scripts/Modules/Storage.gd @@ -7,7 +7,7 @@ enum TYPE {AMMO, GUNPOWDER, COAL} @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 66ef5fa..1e1a0bf 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) @@ -176,4 +177,6 @@ func clearInventory(): print("cleared") walking = "walking" idle = "idle" - + + +