Added player save function to "persistent" tag, added UI elements

This commit is contained in:
Derek
2024-12-08 16:08:43 -06:00
parent 3938e53eed
commit f61807a572
24 changed files with 5945 additions and 192 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bwl5sqoq7acfv"
path="res://.godot/imported/Stamina_v2@0.5x.png-d545156377066e94b316708df44e6ee0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/UI/0.5x/Stamina_v2@0.5x.png"
dest_files=["res://.godot/imported/Stamina_v2@0.5x.png-d545156377066e94b316708df44e6ee0.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

BIN
assets/UI/1x/Stamina_v1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://do1ilw47qvcgo"
path="res://.godot/imported/Stamina_v1.png-31dbe7d8bf1e45a3f157641f18d44e77.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/UI/1x/Stamina_v1.png"
dest_files=["res://.godot/imported/Stamina_v1.png-31dbe7d8bf1e45a3f157641f18d44e77.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

BIN
assets/UI/1x/Stamina_v2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bm6nfjdtevn0l"
path="res://.godot/imported/Stamina_v2.png-2f749d052feec915fecfe561a379c225.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/UI/1x/Stamina_v2.png"
dest_files=["res://.godot/imported/Stamina_v2.png-2f749d052feec915fecfe561a379c225.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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -37,6 +37,6 @@ shadow_mesh = SubResource("ArrayMesh_incmo")
[node name="Grass1" type="Node3D"]
[node name="Plane" type="MeshInstance3D" parent="."]
transform = Transform3D(-1, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0.303801)
transform = Transform3D(-1, 0, 0, 0, 4.37114e-08, -1, 0, 1, 4.37114e-08, 0, 0, 0.303801)
mesh = SubResource("ArrayMesh_8s5ol")
skeleton = NodePath("")

View File

@@ -1,13 +1,9 @@
[gd_scene load_steps=33 format=3 uid="uid://drwae3loscbw7"]
[gd_scene load_steps=31 format=3 uid="uid://drwae3loscbw7"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_x7wms"]
[ext_resource type="Script" path="res://scripts/recoil.gd" id="3_405jc"]
[ext_resource type="FontFile" uid="uid://d2h2tjhxiv5wo" path="res://assets/fonts/White On Black.ttf" id="3_mbuvp"]
[ext_resource type="Script" path="res://scripts/AmmoCounter.gd" id="4_8cy44"]
[ext_resource type="Texture2D" uid="uid://cknftvqq8rbrm" path="res://assets/Textures/Cookie_tutorial_texture_flashlight.png" id="4_x670l"]
[ext_resource type="Texture2D" uid="uid://mcay8s80071h" path="res://assets/UI/Crosshair/SVG/Reticle 1_svg.svg" id="6_5m60e"]
[ext_resource type="Script" path="res://scripts/StaminaCounter.gd" id="6_bgi8o"]
[ext_resource type="Script" path="res://scripts/UIScreenAdjust.gd" id="7_pnp4a"]
[ext_resource type="PackedScene" uid="uid://br882tlh3cfwu" path="res://hud.tscn" id="5_yenaw"]
[ext_resource type="AudioStream" uid="uid://bki17g7j4kqn4" path="res://assets/Audio/PickupSound Mixdown 3.wav" id="8_dwqsx"]
[ext_resource type="Script" path="res://scripts/bullet_ray.gd" id="10_ektr6"]
[ext_resource type="AudioStream" uid="uid://dyd272r7n2ecd" path="res://assets/Audio/footsteps-shoes-jump-land-beach-sand-SBA-300118001.wav" id="10_tn0pn"]
@@ -22,6 +18,8 @@
[ext_resource type="AudioStream" uid="uid://n3e7s3xucsi1" path="res://assets/Audio/Foley Inventory and Interactions/Foley Inventory and Interactions/Drop Item/Drop Jewelery B.wav" id="20_rvr83"]
[ext_resource type="AudioStream" uid="uid://ig4e5tgbh87m" path="res://assets/Audio/Player Character SFX/footsteps-tennis-shoes-walk-1.wav" id="21_fsjho"]
[ext_resource type="AudioStream" uid="uid://c7bwilypn74lc" path="res://assets/Audio/Foley Sports/Hockey/Ball Hit Leg.wav" id="22_c88rq"]
[ext_resource type="AudioStream" uid="uid://cpargxdhuh8dg" path="res://assets/Audio/Foley Inventory and Interactions/Foley Inventory and Interactions/Drop Item/Drop Cloth D.wav" id="23_u78r2"]
[ext_resource type="AudioStream" uid="uid://krod4c6cb6xd" path="res://assets/Audio/Foley Inventory and Interactions/Foley Inventory and Interactions/Drop Item/Drop Cloth C.wav" id="24_2p12q"]
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_l5ga0"]
blend_mode = 1
@@ -36,12 +34,6 @@ height = 2.03547
radius = 0.509802
height = 1.19106
[sub_resource type="LabelSettings" id="LabelSettings_n0odj"]
font = ExtResource("3_mbuvp")
font_size = 115
shadow_size = 16
shadow_color = Color(0, 0, 0, 1)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ubnx7"]
shader = ExtResource("14_v5svg")
shader_parameter/overlay = true
@@ -82,7 +74,13 @@ random_pitch = 1.1
streams_count = 1
stream_0/stream = ExtResource("22_c88rq")
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("weapon_holder") groups=["player"]]
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_xswn0"]
random_pitch = 2.0
streams_count = 2
stream_0/stream = ExtResource("23_u78r2")
stream_1/stream = ExtResource("24_2p12q")
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("weapon_holder") groups=["persist", "player"]]
transform = Transform3D(1, 0.000164476, 0.000583754, -0.000165075, 0.999999, 0.00104027, -0.000583585, -0.00104036, 0.999999, 0, 1.11359, 0)
collision_layer = 6
collision_mask = 11
@@ -128,7 +126,7 @@ current = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0341401, -0.111267)
[node name="WeaponSpawner" type="Node3D" parent="Head/Recoil/Camera3D/WeaponHolder"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.269894, -0.199195, -0.580209)
transform = Transform3D(1, -2.5409e-11, -1.16415e-10, 3.69482e-12, 1, 0, 1.16415e-10, 2.32831e-10, 1, 0.269894, -0.199195, -0.580209)
[node name="Flashlight" type="SpotLight3D" parent="Head/Recoil/Camera3D/WeaponHolder"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.183578, -0.664453)
@@ -145,28 +143,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.437954, -1)
stream = ExtResource("14_pnsbm")
volume_db = 2.0
[node name="AmmoCounter" type="Label" parent="Head/Recoil/Camera3D" groups=["hud"]]
offset_right = 3840.0
offset_bottom = 2160.0
size_flags_horizontal = 3
size_flags_vertical = 6
text = "Ammo: X"
label_settings = SubResource("LabelSettings_n0odj")
horizontal_alignment = 2
vertical_alignment = 2
script = ExtResource("4_8cy44")
padding_amount = 0.025
[node name="StaminaCounter" type="Label" parent="Head/Recoil/Camera3D" groups=["hud"]]
offset_right = 3440.0
offset_bottom = 1440.0
size_flags_horizontal = 3
size_flags_vertical = 6
text = "stamina: X"
label_settings = SubResource("LabelSettings_n0odj")
vertical_alignment = 2
script = ExtResource("6_bgi8o")
padding_amount = 0.025
[node name="HUD" parent="Head/Recoil/Camera3D" instance=ExtResource("5_yenaw")]
[node name="GunRay" type="RayCast3D" parent="Head/Recoil/Camera3D" groups=["gun_ray"]]
transform = Transform3D(0.977933, 0, -0.208919, 0, 1, 7.45058e-09, 0.208919, 0, 0.977933, 0, -0.197421, -0.129669)
@@ -176,21 +153,6 @@ hit_back_faces = false
[node name="AudioListener3D" type="AudioListener3D" parent="Head/Recoil/Camera3D"]
transform = Transform3D(1, 0, 0, 0, 0.992332, 0.123601, 0, -0.123601, 0.992332, 0, -0.921646, -0.000722691)
[node name="Crosshair" type="TextureRect" parent="Head/Recoil/Camera3D" groups=["hud"]]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("6_5m60e")
script = ExtResource("7_pnp4a")
[node name="BulletRay" type="RayCast3D" parent="Head/Recoil/Camera3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.487738)
target_position = Vector3(0, 0, -200)
@@ -281,6 +243,9 @@ volume_db = 6.0
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.42626, 0)
stream = SubResource("AudioStreamRandomizer_u5cxn")
[node name="Crouch" type="AudioStreamPlayer3D" parent="Audio"]
stream = SubResource("AudioStreamRandomizer_xswn0")
[connection signal="tree_entered" from="." to="." method="_on_tree_entered"]
[connection signal="body_entered" from="pick_up_detection" to="." method="_on_pick_up_detection_body_entered"]
[connection signal="body_entered" from="pick_up_magnet" to="." method="_on_pick_up_magnet_body_entered"]