major rework on pickups, hud now shows the number and icon of pickup
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 41 KiB |
BIN
assets/Textures/ObjectTextures/health.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
34
assets/Textures/ObjectTextures/health.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://sejtwkyo0gud"
|
||||||
|
path="res://.godot/imported/health.png-575c2a7a539cccc3e9e8faf465448f98.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/Textures/ObjectTextures/health.png"
|
||||||
|
dest_files=["res://.godot/imported/health.png-575c2a7a539cccc3e9e8faf465448f98.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/Textures/ObjectTextures/light_ammo.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
34
assets/Textures/ObjectTextures/light_ammo.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://b78u3lgx12beh"
|
||||||
|
path="res://.godot/imported/light_ammo.png-ecedb7822d9b26f07643f77fa25aeaea.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/Textures/ObjectTextures/light_ammo.png"
|
||||||
|
dest_files=["res://.godot/imported/light_ammo.png-ecedb7822d9b26f07643f77fa25aeaea.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
|
||||||
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 26 KiB |
BIN
assets/Textures/ObjectTextures/money.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
34
assets/Textures/ObjectTextures/money.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bt6utik8unkxa"
|
||||||
|
path="res://.godot/imported/money.png-0c7bd269242ca0e7919fce1578029628.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/Textures/ObjectTextures/money.png"
|
||||||
|
dest_files=["res://.godot/imported/money.png-0c7bd269242ca0e7919fce1578029628.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
|
||||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 12 KiB |
BIN
assets/Textures/ObjectTextures/rocket.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
34
assets/Textures/ObjectTextures/rocket.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cmnhd40dvn3l3"
|
||||||
|
path="res://.godot/imported/rocket.png-f48667c8e74138b1121c9aaa249e2648.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/Textures/ObjectTextures/rocket.png"
|
||||||
|
dest_files=["res://.godot/imported/rocket.png-f48667c8e74138b1121c9aaa249e2648.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/Textures/ObjectTextures/stamina.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
34
assets/Textures/ObjectTextures/stamina.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dcyt3k3jl6ick"
|
||||||
|
path="res://.godot/imported/stamina.png-abaab6a291d46ce1aecf01bde6dd6d30.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/Textures/ObjectTextures/stamina.png"
|
||||||
|
dest_files=["res://.godot/imported/stamina.png-abaab6a291d46ce1aecf01bde6dd6d30.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
|
||||||
329
assets/item_pickup.tscn
Normal file
@@ -235,7 +235,7 @@ points = PackedVector3Array(-0.899645, -0.235985, -0.176739, 0.797351, 0.356305,
|
|||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_87tum"]
|
[sub_resource type="SphereShape3D" id="SphereShape3D_87tum"]
|
||||||
radius = 1.26183
|
radius = 1.26183
|
||||||
|
|
||||||
[node name="mac10_pickup" type="RigidBody3D" node_paths=PackedStringArray("collision_shape") groups=["pickup"]]
|
[node name="mac10_pickup" type="RigidBody3D" node_paths=PackedStringArray("collision_shape") groups=["pickup", "weapon_pickup"]]
|
||||||
collision_layer = 17
|
collision_layer = 17
|
||||||
collision_mask = 17
|
collision_mask = 17
|
||||||
script = ExtResource("1_46utd")
|
script = ExtResource("1_46utd")
|
||||||
|
|||||||
@@ -702,7 +702,7 @@ audio_empty = NodePath("Audio/Empty")
|
|||||||
audio_reload = NodePath("Audio/Reload")
|
audio_reload = NodePath("Audio/Reload")
|
||||||
|
|
||||||
[node name="mac10" parent="." index="0"]
|
[node name="mac10" parent="." index="0"]
|
||||||
transform = Transform3D(-1.08301e-06, -8.05106e-08, -0.3, -0.0225093, 0.299154, 9.75562e-10, 0.299154, 0.0225093, -1.086e-06, -0.00876398, 0.0748287, -0.0557729)
|
transform = Transform3D(-1.08301e-06, -8.05104e-08, -0.3, -0.0225093, 0.299154, 9.75766e-10, 0.299154, 0.0225093, -1.086e-06, -0.00876398, 0.0748287, -0.0557729)
|
||||||
cast_shadow = 0
|
cast_shadow = 0
|
||||||
lod_bias = 10.0
|
lod_bias = 10.0
|
||||||
mesh = SubResource("ArrayMesh_pcg38")
|
mesh = SubResource("ArrayMesh_pcg38")
|
||||||
|
|||||||
46
assets/pickup_item_indicator.tscn
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://x3uwmwbobkoy"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/pickup_item_indicator.gd" id="1_3ji4d"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cmnhd40dvn3l3" path="res://assets/Textures/ObjectTextures/rocket.png" id="1_xksdo"]
|
||||||
|
[ext_resource type="Theme" uid="uid://buma708jpxqrn" path="res://Clean_theme.tres" id="3_etc64"]
|
||||||
|
|
||||||
|
[node name="PickupItemIndicator" type="Control"]
|
||||||
|
z_index = -1
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 0
|
||||||
|
offset_right = 250.0
|
||||||
|
offset_bottom = 250.0
|
||||||
|
script = ExtResource("1_3ji4d")
|
||||||
|
|
||||||
|
[node name="image" type="TextureRect" parent="."]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = -226.0
|
||||||
|
offset_top = -131.0
|
||||||
|
offset_right = 286.0
|
||||||
|
offset_bottom = 381.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
size_flags_vertical = 4
|
||||||
|
texture = ExtResource("1_xksdo")
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="image"]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = -100.0
|
||||||
|
offset_top = -42.0
|
||||||
|
offset_right = 86.0
|
||||||
|
offset_bottom = 63.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
theme = ExtResource("3_etc64")
|
||||||
|
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||||
|
theme_override_constants/outline_size = 19
|
||||||
|
theme_override_font_sizes/font_size = 100
|
||||||
|
text = "999"
|
||||||
|
horizontal_alignment = 1
|
||||||
@@ -1460,10 +1460,12 @@ transform = Transform3D(4.17223e-07, 5.99699e-19, 2.10229, -2.98023e-07, -2.1022
|
|||||||
transform = Transform3D(4.17223e-07, 7.04731e-19, 2.10229, -2.98023e-07, -2.10229, -5.96046e-08, 2.1023, -2.38418e-07, -2.98033e-07, 0.126097, 0.1392, -0.0677698)
|
transform = Transform3D(4.17223e-07, 7.04731e-19, 2.10229, -2.98023e-07, -2.10229, -5.96046e-08, 2.1023, -2.38418e-07, -2.98033e-07, 0.126097, 0.1392, -0.0677698)
|
||||||
|
|
||||||
[node name="hammer" parent="revolver1" index="1"]
|
[node name="hammer" parent="revolver1" index="1"]
|
||||||
|
cast_shadow = 0
|
||||||
mesh = SubResource("ArrayMesh_0w43n")
|
mesh = SubResource("ArrayMesh_0w43n")
|
||||||
|
|
||||||
[node name="Trigger" parent="revolver1" index="2"]
|
[node name="Trigger" parent="revolver1" index="2"]
|
||||||
transform = Transform3D(0.207537, -0.978227, 4.27597e-08, 0, -4.37114e-08, -1, 0.978227, 0.207537, -9.07173e-09, 0.226752, 0, -0.00209358)
|
transform = Transform3D(0.207537, -0.978227, 4.27597e-08, 0, -4.37114e-08, -1, 0.978227, 0.207537, -9.07173e-09, 0.226752, 0, -0.00209358)
|
||||||
|
cast_shadow = 0
|
||||||
mesh = SubResource("ArrayMesh_ahftj")
|
mesh = SubResource("ArrayMesh_ahftj")
|
||||||
|
|
||||||
[node name="flare" type="MeshInstance3D" parent="revolver1" index="3"]
|
[node name="flare" type="MeshInstance3D" parent="revolver1" index="3"]
|
||||||
|
|||||||
5
hud.tscn
@@ -161,6 +161,7 @@ layout_mode = 2
|
|||||||
theme = ExtResource("1_22trs")
|
theme = ExtResource("1_22trs")
|
||||||
theme_type_variation = &"TextShadow"
|
theme_type_variation = &"TextShadow"
|
||||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||||
|
theme_override_constants/outline_size = 15
|
||||||
text = "Gun Name"
|
text = "Gun Name"
|
||||||
horizontal_alignment = 2
|
horizontal_alignment = 2
|
||||||
|
|
||||||
@@ -174,17 +175,19 @@ alignment = 2
|
|||||||
[node name="AmmoCurrent" type="Label" parent="GunInfo/VBoxContainer/HBoxContainer"]
|
[node name="AmmoCurrent" type="Label" parent="GunInfo/VBoxContainer/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme = ExtResource("1_22trs")
|
theme = ExtResource("1_22trs")
|
||||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
theme_override_constants/outline_size = 15
|
||||||
text = "XXX"
|
text = "XXX"
|
||||||
horizontal_alignment = 2
|
horizontal_alignment = 2
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="GunInfo/VBoxContainer/HBoxContainer"]
|
[node name="Label" type="Label" parent="GunInfo/VBoxContainer/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
theme_override_constants/outline_size = 15
|
||||||
text = "-"
|
text = "-"
|
||||||
|
|
||||||
[node name="AmmoReserve" type="Label" parent="GunInfo/VBoxContainer/HBoxContainer"]
|
[node name="AmmoReserve" type="Label" parent="GunInfo/VBoxContainer/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme = ExtResource("1_22trs")
|
theme = ExtResource("1_22trs")
|
||||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||||
|
theme_override_constants/outline_size = 15
|
||||||
text = "YYY"
|
text = "YYY"
|
||||||
horizontal_alignment = 2
|
horizontal_alignment = 2
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ spawned=""
|
|||||||
persist=""
|
persist=""
|
||||||
breakable=""
|
breakable=""
|
||||||
leak="will leak if damaged"
|
leak="will leak if damaged"
|
||||||
|
item_pickup=""
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=25 format=3 uid="uid://breenfpt04iua"]
|
[gd_scene load_steps=26 format=3 uid="uid://breenfpt04iua"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/LevelManager.gd" id="1_8g3mj"]
|
[ext_resource type="Script" path="res://scripts/LevelManager.gd" id="1_8g3mj"]
|
||||||
[ext_resource type="PackedScene" uid="uid://xerc06hjfnbf" path="res://assets/LevelBlockouts/blockout4.blend" id="1_038d8"]
|
[ext_resource type="PackedScene" uid="uid://xerc06hjfnbf" path="res://assets/LevelBlockouts/blockout4.blend" id="1_038d8"]
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://dyu46bns8mesv" path="res://assets/mac10_pickup.tscn" id="18_c33jr"]
|
[ext_resource type="PackedScene" uid="uid://dyu46bns8mesv" path="res://assets/mac10_pickup.tscn" id="18_c33jr"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dws4iro7820fc" path="res://assets/pistol1_pickup.tscn" id="19_1o424"]
|
[ext_resource type="PackedScene" uid="uid://dws4iro7820fc" path="res://assets/pistol1_pickup.tscn" id="19_1o424"]
|
||||||
[ext_resource type="PackedScene" uid="uid://clu76sc4uoswn" path="res://assets/rocketlauncher_pickup.tscn" id="20_4cdch"]
|
[ext_resource type="PackedScene" uid="uid://clu76sc4uoswn" path="res://assets/rocketlauncher_pickup.tscn" id="20_4cdch"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dws2vwfxubqvb" path="res://assets/cannon.tscn" id="21_24v0y"]
|
||||||
|
|
||||||
[sub_resource type="Environment" id="Environment_q4t3f"]
|
[sub_resource type="Environment" id="Environment_q4t3f"]
|
||||||
ssr_enabled = true
|
ssr_enabled = true
|
||||||
@@ -34,7 +35,7 @@ fog_density = 0.0005
|
|||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_sc3mk"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_sc3mk"]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hs00l"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_tk3rh"]
|
||||||
render_priority = 0
|
render_priority = 0
|
||||||
next_pass = SubResource("ShaderMaterial_sc3mk")
|
next_pass = SubResource("ShaderMaterial_sc3mk")
|
||||||
shader = ExtResource("17_s06ug")
|
shader = ExtResource("17_s06ug")
|
||||||
@@ -51,7 +52,7 @@ shader_parameter/grazing_angle_mask_power = 1.0
|
|||||||
shader_parameter/grazing_angle_modulation_factor = 50.0
|
shader_parameter/grazing_angle_modulation_factor = 50.0
|
||||||
|
|
||||||
[sub_resource type="QuadMesh" id="QuadMesh_nmuj5"]
|
[sub_resource type="QuadMesh" id="QuadMesh_nmuj5"]
|
||||||
material = SubResource("ShaderMaterial_hs00l")
|
material = SubResource("ShaderMaterial_tk3rh")
|
||||||
flip_faces = true
|
flip_faces = true
|
||||||
size = Vector2(2, 2)
|
size = Vector2(2, 2)
|
||||||
|
|
||||||
@@ -673,3 +674,9 @@ transform = Transform3D(0.44329, 0.896378, 0, -0.896378, 0.44329, 0, 0, 0, 1, -2
|
|||||||
|
|
||||||
[node name="rocketlauncher1_pickup" parent="." instance=ExtResource("20_4cdch")]
|
[node name="rocketlauncher1_pickup" parent="." instance=ExtResource("20_4cdch")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -17.4244, 1.087, -30.9826)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -17.4244, 1.087, -30.9826)
|
||||||
|
|
||||||
|
[node name="cannon" parent="." instance=ExtResource("21_24v0y")]
|
||||||
|
transform = Transform3D(0.978792, -0.185004, 0.0879728, 0, 0.42944, 0.903096, -0.204855, -0.883943, 0.420332, 31.5816, 0.696903, -7.64441)
|
||||||
|
CANNON_MIN_POWER = 20
|
||||||
|
CANNON_MAX_POWER = 50
|
||||||
|
TIMER_MAX = 1.0
|
||||||
|
|||||||
@@ -2,24 +2,15 @@ extends Node3D
|
|||||||
|
|
||||||
@export var CANNON_MIN_POWER = 7
|
@export var CANNON_MIN_POWER = 7
|
||||||
@export var CANNON_MAX_POWER = 20
|
@export var CANNON_MAX_POWER = 20
|
||||||
@export var TIMER_MIN = 0
|
@export var TIMER_MIN = 0.0
|
||||||
@export var TIMER_MAX = 20
|
@export var TIMER_MAX = 20.0
|
||||||
|
|
||||||
@export var stamina : Resource
|
|
||||||
@export var ammo : Resource
|
|
||||||
@export var jump : Resource
|
|
||||||
@export var money : Resource
|
|
||||||
|
|
||||||
|
@onready var item_pickup = preload("res://assets/item_pickup.tscn")
|
||||||
@onready var timer = $Timer
|
@onready var timer = $Timer
|
||||||
@onready var cannonparticles = $cannonparticles
|
@onready var cannonparticles = $cannonparticles
|
||||||
@onready var cannon_dir = $RayCast3D
|
@onready var cannon_dir = $RayCast3D
|
||||||
@onready var fire_audio = $Audio/FireAudio
|
@onready var fire_audio = $Audio/FireAudio
|
||||||
|
|
||||||
|
|
||||||
var rand_item
|
|
||||||
var rand_select
|
|
||||||
var rng = RandomNumberGenerator.new()
|
|
||||||
var rand_rot_y
|
|
||||||
var fire = true
|
var fire = true
|
||||||
|
|
||||||
|
|
||||||
@@ -34,27 +25,23 @@ func _process(delta):
|
|||||||
|
|
||||||
func _on_timer_timeout():
|
func _on_timer_timeout():
|
||||||
# Random Variables
|
# Random Variables
|
||||||
var lv_y = rng.randf_range(CANNON_MIN_POWER,CANNON_MAX_POWER)
|
var lv_y = randf_range(CANNON_MIN_POWER,CANNON_MAX_POWER)
|
||||||
var rand_selector = int(round(rng.randf_range(1,3)))
|
var rand_timer = randf_range(TIMER_MIN,TIMER_MAX)
|
||||||
var rand_timer = rng.randf_range(TIMER_MIN,TIMER_MAX)
|
|
||||||
|
|
||||||
match rand_selector:
|
|
||||||
1:
|
|
||||||
rand_select = stamina
|
|
||||||
2:
|
|
||||||
rand_select = ammo
|
|
||||||
3:
|
|
||||||
rand_select = money
|
|
||||||
|
|
||||||
# Reset Timer
|
# Reset Timer
|
||||||
timer.wait_time = rand_timer #rand_timer
|
timer.wait_time = rand_timer #rand_timer
|
||||||
|
|
||||||
# Shoot that shit
|
# Shoot that shit
|
||||||
rand_item = rand_select.instantiate()
|
var pickup_spawn = item_pickup.instantiate()
|
||||||
rand_item.position = cannon_dir.global_position
|
##SET VARIABLES
|
||||||
rand_item.transform.basis = cannon_dir.global_transform.basis
|
var type = randi_range(0,3)
|
||||||
rand_item.linear_velocity += cannon_dir.global_transform.basis * Vector3(0,lv_y,0)
|
pickup_spawn.pickup_type = type
|
||||||
#cannonparticles.emitting = true
|
if type == 0:
|
||||||
#fir_audio.pitch_scale =
|
pickup_spawn.ammo_type = randi_range(0,4)
|
||||||
|
pickup_spawn.value = randi_range(1,10)
|
||||||
|
|
||||||
|
pickup_spawn.position = cannon_dir.global_position
|
||||||
|
pickup_spawn.transform.basis = cannon_dir.global_transform.basis
|
||||||
|
pickup_spawn.linear_velocity += cannon_dir.global_transform.basis * Vector3(0,lv_y,0)
|
||||||
fire_audio.play()
|
fire_audio.play()
|
||||||
get_parent().add_child(rand_item)
|
get_parent().add_child(pickup_spawn)
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ var crosshair_target
|
|||||||
@onready var money: Label = $Money
|
@onready var money: Label = $Money
|
||||||
@onready var crosshair: TextureRect = $Crosshair
|
@onready var crosshair: TextureRect = $Crosshair
|
||||||
@onready var crosshair_center: TextureRect = $CrosshairCenter
|
@onready var crosshair_center: TextureRect = $CrosshairCenter
|
||||||
|
@onready var pickup_item_indicator = preload("res://assets/pickup_item_indicator.tscn")
|
||||||
|
|
||||||
const FULL_WHITE = Color(1, 1, 1, 1)
|
const FULL_WHITE = Color(1, 1, 1, 1)
|
||||||
const TRANSPARENT = Color(1, 1, 1, 0)
|
const TRANSPARENT = Color(1, 1, 1, 0)
|
||||||
@@ -36,6 +37,9 @@ const GREEN_COLOR = Color(0, 0.608, 0.172)
|
|||||||
const STAM_BAR_MAX_OPACITY = 1.0
|
const STAM_BAR_MAX_OPACITY = 1.0
|
||||||
const CROSSHAIR_SIZE = Vector2(40,40)
|
const CROSSHAIR_SIZE = Vector2(40,40)
|
||||||
|
|
||||||
|
var pickup_notifs = []
|
||||||
|
var can_spawn = true
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
# Get Viewport size
|
# Get Viewport size
|
||||||
@@ -62,6 +66,7 @@ func _ready() -> void:
|
|||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
player = level_control.player
|
player = level_control.player
|
||||||
|
|
||||||
if player != null:
|
if player != null:
|
||||||
# Crosshair
|
# Crosshair
|
||||||
crosshair_target = lerp(crosshair_target,CROSSHAIR_SIZE,delta * 5)
|
crosshair_target = lerp(crosshair_target,CROSSHAIR_SIZE,delta * 5)
|
||||||
@@ -156,6 +161,9 @@ func _process(delta: float) -> void:
|
|||||||
|
|
||||||
## FADE ELEMENTS IN AND OUT
|
## FADE ELEMENTS IN AND OUT
|
||||||
fade_in_out(current_stam_bar,STAM_BAR_MAX_OPACITY,stam_bar_visible,5,delta)
|
fade_in_out(current_stam_bar,STAM_BAR_MAX_OPACITY,stam_bar_visible,5,delta)
|
||||||
|
|
||||||
|
## SPAWN NOTIFICATIONS
|
||||||
|
spawn_notifs()
|
||||||
|
|
||||||
func crosshair_size_change():
|
func crosshair_size_change():
|
||||||
crosshair_target += Vector2(20,20)
|
crosshair_target += Vector2(20,20)
|
||||||
@@ -184,6 +192,23 @@ func fade_in_out(element,MAX_OPACITY,visible,speed,delta):
|
|||||||
else:
|
else:
|
||||||
element.modulate = lerp(element_color, Color(element_color.r,element_color.g,element_color.b,0),(delta * speed)/Engine.time_scale)
|
element.modulate = lerp(element_color, Color(element_color.r,element_color.g,element_color.b,0),(delta * speed)/Engine.time_scale)
|
||||||
|
|
||||||
|
func pick_up_notif(type,ammo_type,value):
|
||||||
|
var pickup_notif = pickup_item_indicator.instantiate()
|
||||||
|
pickup_notif.pickup_type = type
|
||||||
|
pickup_notif.ammo_type = ammo_type
|
||||||
|
pickup_notif.value = value
|
||||||
|
pickup_notif.position = money.position + Vector2(150,-50)
|
||||||
|
pickup_notif.scale = Vector2(1,1)
|
||||||
|
pickup_notifs.append(pickup_notif)
|
||||||
|
|
||||||
|
func spawn_notifs():
|
||||||
|
if pickup_notifs.size() > 0 and can_spawn:
|
||||||
|
can_spawn = false
|
||||||
|
var msg = pickup_notifs.pop_front()
|
||||||
|
add_child(msg)
|
||||||
|
await get_tree().create_timer(.2).timeout
|
||||||
|
can_spawn = true
|
||||||
|
|
||||||
func player_hit():
|
func player_hit():
|
||||||
pass
|
pass
|
||||||
#self.position += wiggle_element(25)
|
#self.position += wiggle_element(25)
|
||||||
|
|||||||
100
scripts/item_pickup_v2.gd
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
extends RigidBody3D
|
||||||
|
|
||||||
|
var despawning = false
|
||||||
|
var despawn_time_s = 10
|
||||||
|
|
||||||
|
var value
|
||||||
|
@export_enum("Ammo", "Stamina", "Health", "Money","Weapon") var pickup_type: int
|
||||||
|
var ammo_type
|
||||||
|
|
||||||
|
@onready var collision_shape: CollisionShape3D = $CollisionShape3D2
|
||||||
|
@onready var timer: Timer = $Timer
|
||||||
|
|
||||||
|
## MESHES
|
||||||
|
#AMMO
|
||||||
|
@onready var light_ammo: MeshInstance3D = $Meshes/Ammo/light_ammo
|
||||||
|
@onready var rocket: MeshInstance3D = $Meshes/Ammo/rocket
|
||||||
|
|
||||||
|
@onready var stamina: MeshInstance3D = $Meshes/stamina
|
||||||
|
@onready var health: MeshInstance3D = $Meshes/health
|
||||||
|
@onready var money: Node3D = $Meshes/money
|
||||||
|
|
||||||
|
|
||||||
|
var magnetable = true #false
|
||||||
|
var pickupable = false
|
||||||
|
var pick_up = false
|
||||||
|
var rand_amt
|
||||||
|
var player_follow
|
||||||
|
var player
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready():
|
||||||
|
add_to_group("spawned")
|
||||||
|
add_to_group("persist")
|
||||||
|
|
||||||
|
#Enable mesh
|
||||||
|
|
||||||
|
match pickup_type:
|
||||||
|
0:
|
||||||
|
match ammo_type:
|
||||||
|
0:
|
||||||
|
light_ammo.visible = true
|
||||||
|
1:
|
||||||
|
light_ammo.visible = true #medium
|
||||||
|
2:
|
||||||
|
light_ammo.visible = true #heavy
|
||||||
|
3:
|
||||||
|
light_ammo.visible = true #shotgun
|
||||||
|
4:
|
||||||
|
rocket.visible = true #rocket
|
||||||
|
1:
|
||||||
|
stamina.visible = true
|
||||||
|
2:
|
||||||
|
health.visible = true
|
||||||
|
3:
|
||||||
|
money.visible = true
|
||||||
|
|
||||||
|
|
||||||
|
if despawning == true:
|
||||||
|
timer.wait_time = despawn_time_s
|
||||||
|
timer.start()
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
if player_follow != null:
|
||||||
|
if !pick_up:
|
||||||
|
despawning = false
|
||||||
|
angular_velocity = lerp(angular_velocity, Vector3(0,0,0), delta)
|
||||||
|
position = lerp(position, player.item_holder.global_position, 25 * delta)
|
||||||
|
|
||||||
|
if abs(position - player.item_holder.global_position) < Vector3(.5,.5,.5):
|
||||||
|
await get_tree().create_timer(1).timeout
|
||||||
|
position = lerp(position, player.camera.global_position, .01 * delta)
|
||||||
|
await get_tree().create_timer(.01).timeout
|
||||||
|
player.pickup_apply(pickup_type,ammo_type,value)
|
||||||
|
queue_free()
|
||||||
|
|
||||||
|
func _on_timer_timeout() -> void:
|
||||||
|
if despawning == true:
|
||||||
|
collision_shape.disabled = true
|
||||||
|
await get_tree().create_timer(1).timeout
|
||||||
|
self.queue_free()
|
||||||
|
|
||||||
|
func save():
|
||||||
|
var save_dict = {
|
||||||
|
"filename" : get_scene_file_path(),
|
||||||
|
"parent" : get_parent().get_path(),
|
||||||
|
"pos_x" : position.x,
|
||||||
|
"pos_y" : position.y,
|
||||||
|
"pos_z" : position.z,
|
||||||
|
"rot_x" : rotation.x,
|
||||||
|
"rot_y" : rotation.y,
|
||||||
|
"rot_z" : rotation.z,
|
||||||
|
"pickup_type" : pickup_type,
|
||||||
|
"ammo_type" : ammo_type,
|
||||||
|
"value" : value
|
||||||
|
}
|
||||||
|
return save_dict
|
||||||
|
|
||||||
|
|
||||||
|
func _on_magnet_timer_timeout() -> void:
|
||||||
|
magnetable = true
|
||||||
66
scripts/pickup_item_indicator.gd
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
@onready var image: TextureRect = $image
|
||||||
|
@onready var label: Label = $image/Label
|
||||||
|
|
||||||
|
|
||||||
|
## ITEM TEXTURES
|
||||||
|
#AMMO
|
||||||
|
const LIGHT_AMMO = preload("res://assets/Textures/ObjectTextures/light_ammo.png")
|
||||||
|
const ROCKET = preload("res://assets/Textures/ObjectTextures/rocket.png")
|
||||||
|
|
||||||
|
const MONEY = preload("res://assets/Textures/ObjectTextures/money.png")
|
||||||
|
const HEALTH = preload("res://assets/Textures/ObjectTextures/health.png")
|
||||||
|
const STAMINA = preload("res://assets/Textures/ObjectTextures/stamina.png")
|
||||||
|
|
||||||
|
var pickup_type
|
||||||
|
var ammo_type
|
||||||
|
var value
|
||||||
|
|
||||||
|
var random_point
|
||||||
|
var alpha_amt : float = 1.0
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
random_point = get_random_point()
|
||||||
|
|
||||||
|
match pickup_type:
|
||||||
|
0:
|
||||||
|
match ammo_type:
|
||||||
|
0:
|
||||||
|
image.texture = LIGHT_AMMO
|
||||||
|
1:
|
||||||
|
image.texture = LIGHT_AMMO #medium
|
||||||
|
2:
|
||||||
|
image.texture = LIGHT_AMMO #heavy
|
||||||
|
3:
|
||||||
|
image.texture = LIGHT_AMMO #shotgun
|
||||||
|
4:
|
||||||
|
image.texture = ROCKET
|
||||||
|
1:
|
||||||
|
image.texture = STAMINA
|
||||||
|
2:
|
||||||
|
image.texture = HEALTH
|
||||||
|
3:
|
||||||
|
image.texture = MONEY
|
||||||
|
|
||||||
|
if pickup_type == 3:
|
||||||
|
label.text = str("$",value)
|
||||||
|
else:
|
||||||
|
label.text = str(value)
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
alpha_amt = lerp(alpha_amt, 0.0,delta * 1)
|
||||||
|
modulate = Color(1, 1, 1, alpha_amt)
|
||||||
|
position += random_point * delta * 2
|
||||||
|
scale -= Vector2(.2,.2) * delta
|
||||||
|
if alpha_amt <= .01:
|
||||||
|
queue_free()
|
||||||
|
|
||||||
|
func get_random_point():
|
||||||
|
var x_pos = randf_range(-50,50)
|
||||||
|
var y_pos = randf_range(-250,-300)
|
||||||
|
|
||||||
|
return Vector2(x_pos,y_pos)
|
||||||
@@ -621,17 +621,40 @@ func add_ammo(new_gun,gun_name,ammo_type,max_ammo,start_mags):
|
|||||||
|
|
||||||
func _on_pick_up_detection_body_entered(body):
|
func _on_pick_up_detection_body_entered(body):
|
||||||
|
|
||||||
if body.is_in_group("pickup"):
|
if body.is_in_group("item_pickup"):
|
||||||
if body.pickupable:
|
pass
|
||||||
body.picked_up()
|
#if body.pickupable:
|
||||||
if body.is_in_group("weapon_pickup"):
|
#pickup_apply(body.pickup_type,body.ammo_type,body.value)
|
||||||
weapon_pickup_audio.play()
|
if body.is_in_group("weapon_pickup"):
|
||||||
Input.start_joy_vibration(0,.1,.1,.1)
|
body.picked_up()
|
||||||
|
weapon_pickup_audio.play()
|
||||||
|
Input.start_joy_vibration(0,.1,.1,.1)
|
||||||
|
|
||||||
func _on_pick_up_magnet_body_entered(body):
|
func _on_pick_up_magnet_body_entered(body):
|
||||||
if body.is_in_group("pickup") and body.is_in_group("magnet"):
|
if body.is_in_group("item_pickup") and body.is_in_group("magnet"):
|
||||||
body.player_follow = self
|
if body.magnetable == true:
|
||||||
body.collision_shape.disabled = true
|
body.player_follow = self
|
||||||
|
body.player = self
|
||||||
|
body.collision_shape.disabled = true
|
||||||
|
|
||||||
|
func pickup_apply(type,ammo_type,value):
|
||||||
|
pickup_sound.play()
|
||||||
|
Input.start_joy_vibration(0,.1,.1,.1)
|
||||||
|
hud.pick_up_notif(type,ammo_type,value)
|
||||||
|
|
||||||
|
match type:
|
||||||
|
0: #AMMO
|
||||||
|
if ammo_reserve.has(str(ammo_type)):
|
||||||
|
ammo_reserve[str(ammo_type)] += value
|
||||||
|
else:
|
||||||
|
ammo_reserve[str(ammo_type)] = value
|
||||||
|
1: #STAMINA
|
||||||
|
remaining_stamina = clamp(remaining_stamina + value,0,100)
|
||||||
|
2: #HEALTH
|
||||||
|
level_control.health += value
|
||||||
|
3: #MONEY
|
||||||
|
level_control.money += value
|
||||||
|
|
||||||
|
|
||||||
func weapon_tilt(input_x, delta):
|
func weapon_tilt(input_x, delta):
|
||||||
if !ads:
|
if !ads:
|
||||||
|
|||||||