Merge branch 'rigidbodybullets_2'

This commit is contained in:
derek
2024-11-04 11:26:55 -06:00
45 changed files with 1071 additions and 246 deletions

View File

@@ -1,24 +0,0 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://66gb63n50tx4"
path="res://.godot/imported/strange-wind-SBA-300082367.wav-7bf43fa911634e3e0eca08ad3ee18746.sample"
[deps]
source_file="res://assets/Audio/Level SFX/strange-wind-SBA-300082367.wav"
dest_files=["res://.godot/imported/strange-wind-SBA-300082367.wav-7bf43fa911634e3e0eca08ad3ee18746.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=2
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View File

@@ -1,2 +0,0 @@
[.ShellClassInfo]
IconResource=C:\Program Files\Google\Drive File Stream\93.0.1.0\GoogleDriveFS.exe,25

View File

@@ -1,24 +0,0 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://diwsk0cw41ep1"
path="res://.godot/imported/easy-walk-SBA-347061820.wav-f1239f3422d42adad8875f7718afbc5b.sample"
[deps]
source_file="res://assets/Audio/Music/Test Songs/easy-walk-SBA-347061820.wav"
dest_files=["res://.godot/imported/easy-walk-SBA-347061820.wav-f1239f3422d42adad8875f7718afbc5b.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View File

@@ -1,24 +0,0 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://cjhpsqek6aqni"
path="res://.godot/imported/soul-slippin-SBA-346830116.wav-8d1dd8be7cdb8c0f5849ddfbc0d3ed31.sample"
[deps]
source_file="res://assets/Audio/Music/Test Songs/soul-slippin-SBA-346830116.wav"
dest_files=["res://.godot/imported/soul-slippin-SBA-346830116.wav-8d1dd8be7cdb8c0f5849ddfbc0d3ed31.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=2
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View File

@@ -1,2 +0,0 @@
[.ShellClassInfo]
IconResource=C:\Program Files\Google\Drive File Stream\93.0.1.0\GoogleDriveFS.exe,25

View File

@@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://b4g14i0hso7dj"
uid="uid://bdb2yv36ffmk8"
path.s3tc="res://.godot/imported/boxcar1.doors.png-7378721e8cbb58b1d0fb0e0d16e93c7d.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],

View File

@@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dtccywxaqkqwk"
uid="uid://bytxye2f8f05c"
path.s3tc="res://.godot/imported/brick1.normal.png-01aaf16db3e9ebf93f0d29868088a593.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],

View File

@@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dreegtc3xivsd"
uid="uid://bxrew37taf7qp"
path.s3tc="res://.godot/imported/garbagebin.lid.normal.png-84ef62d4152d2a5d290861b230593a52.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],

View File

@@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bibvo384ycxub"
uid="uid://446yk8qkr53q"
path.s3tc="res://.godot/imported/mac10.roughness2.png-77b0d965d5e6b9404dba54a97d742d86.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],

View File

@@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://blcxok1w8f4xu"
uid="uid://b36a5av7x827o"
path.s3tc="res://.godot/imported/revolver1.roughness.png-f8c40214b9c261c0a4b2cd9f6a4e9a14.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],

View File

@@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://r7awur11yerj"
uid="uid://b4s3w1qnqcmgq"
path.s3tc="res://.godot/imported/spider1.gunbarrel.albedo.png-463a06da21a5a1fe75e603ecd68d425f.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],

View File

@@ -57,6 +57,7 @@ shadow_mesh = SubResource("ArrayMesh_46pc3")
[node name="ammo_pickup" type="RigidBody3D" node_paths=PackedStringArray("collision_shape") groups=["magnet", "pickup", "scene_rigidbody"]]
collision_layer = 16
collision_mask = 17
continuous_cd = true
script = ExtResource("1_sni3c")
collision_shape = NodePath("CollisionShape3D2")
despawning = true

File diff suppressed because one or more lines are too long

126
assets/bulB228.tmp Normal file
View File

@@ -0,0 +1,126 @@
[gd_scene load_steps=12 format=4 uid="uid://dqhltdnqyg8ni"]
[ext_resource type="Script" path="res://scripts/bullet.gd" id="1_oj0f5"]
[ext_resource type="Texture2D" uid="uid://dqytegxsmb5kg" path="res://assets/Models/bullet.transparency.png" id="2_0ks2n"]
[ext_resource type="AudioStream" uid="uid://dqj4cx05f25jj" path="res://assets/Audio/punch-body-hard-SBA-300156881.wav" id="3_6j0l2"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mfpbf"]
resource_name = "bullet"
transparency = 4
cull_mode = 2
albedo_texture = ExtResource("2_0ks2n")
roughness = 0.5
emission_enabled = true
emission = Color(1, 0.606841, 0.365696, 1)
emission_energy_multiplier = 4.0
[sub_resource type="ArrayMesh" id="ArrayMesh_dtlcm"]
_surfaces = [{
"aabb": AABB(-0.0255907, -0.0689083, -0.0255907, 0.0511814, 0.735285, 0.0511814),
"format": 34359742465,
"index_count": 180,
"index_data": PackedByteArray("AAADAAEAAAACAAMAAgAFAAMAAgAEAAUABAAHAAUABAAGAAcABgAJAAcABgAIAAkACAALAAkACAAKAAsACgANAAsACgAMAA0ABQAQAAMABQASABAADAAPAA0ADAAOAA8ADgABAA8ADgAAAAEADgACAAAAAgAGAAQABgAKAAgACgAOAAwADgAGAAIABgAOAAoAFgAdABUAFgAeAB0ACwAUAAkACwAVABQAAQAXAA8AAQARABcAAwARAAEAAwAQABEABwASAAUABwATABIADQAVAAsADQAWABUACQATAAcACQAUABMADwAWAA0ADwAXABYAGgAZABgAGQAeAB8AHgAcAB0AHAAaABsAGgAeABkAHgAaABwAFAAbABMAFAAcABsAEgAYABAAEgAaABgAFwAeABYAFwAfAB4AFQAcABQAFQAdABwAEwAaABIAEwAbABoAEAAZABEAEAAYABkAEQAfABcAEQAZAB8A"),
"lods": [0.0176836, PackedByteArray("AAAZAAEAAAACABkAAgASABkAEgAaABkAAgAEABIABAAGABIABgAIABIAHQAaABIACAAdABIACAAKAB0ACgAMAB0ADAAfAB0ADAAOAB8ADgABAB8AAQAZAB8ADgAAAAEADgACAAAADgAGAAIAAgAGAAQABgAOAAoACgAOAAwABgAKAAgAGQAdAB8AGgAdABkA"), 0.0191346, PackedByteArray("AAAEAAEABAASAAEAEgAZAAEAEgAaABkABAAMABIAHQAaABIADAAdABIADAABAB0AAQAZAB0ADAAAAAEADAAEAAAAGgAdABkA"), 0.0400226, PackedByteArray("AAAMAAEADAAdAAEAHQAZAAEADAABAB0AAQAZAB0ADAAAAAEA")],
"name": "bullet",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 32,
"vertex_data": PackedByteArray("AAAAAM4fjb2do9G8AAAAALkAIT+Mo9G8sDyUPM4fjb3BPJS8sDyUPLkAIT+wPJS8jKPRPM4fjb0iqQmzjKPRPLkAIT8AAACAsDyUPM4fjb2fPJQ8sDyUPLkAIT+wPJQ8AAAAAM4fjb17o9E8AAAAALkAIT+Mo9E8sDyUvM4fjb2fPJQ8sDyUvLkAIT+wPJQ8jKPRvM4fjb0iqQmzjKPRvLkAIT8AAACAsDyUvM4fjb3BPJS8sDyUvLkAIT+wPJS8nSBDPJymJz+cIEO8AAAAAJymJz/V+Ym81fmJPJymJz9PL4IvnSBDPJymJz+eIEM8AAAAAJymJz/V+Yk8nSBDvJymJz+eIEM81fmJvJymJz9PL4IvnSBDvJymJz+cIEO8bdeSO6uXKj9r15K7tqyfLquXKj9Mqs+7TqrPO6uXKj+nU1AwbdeSO6uXKj9v15I7tqyfLquXKj9Qqs87bdeSu6uXKj9v15I7TqrPu6uXKj+nU1AwbdeSu6uXKj9r15K7")
}]
blend_shape_mode = 0
[sub_resource type="ArrayMesh" id="ArrayMesh_gi7r4"]
resource_name = "gunbullet1_Cylinder"
_surfaces = [{
"aabb": AABB(-0.0255907, -0.0689083, -0.0255907, 0.0511814, 0.735285, 0.0511814),
"attribute_data": PackedByteArray("zVRQPzJjDj9eEic5j/V/PxkeJzkAECc5AAAAP4/1fz8AAAA/j/V/PwEAAD8AECc5AQAAPwAQJzl1UiE/MWMOP9YTJzkr+F8/1hMnOSv4Xz8AAAA/LPhfPwAAAD8s+F8/AAAAPyz4Xz8AAAA/LPhfP+QUAD9AS9o+TRUnOcj6Pz9NFSc5yPo/PwAAAD/I+j8/AAAAP8j6Pz8AAAA/yPo/PwAAAD/I+j8/5RQAPyCNeD7FFic5ZP0fP8UWJzlk/R8/AAAAP2T9Hz8AAAA/ZP0fPwAAAD9k/R8/AAAAP2T9Hz92UiE/uC3nPTwYJzkAAAA/PBgnOQAAAD8BAAA/AAAAPwEAAD8AAAA/AQAAPwAAAD8BAAA/AAAAP85UUD/ALec9sxknOTgFwD6zGSc5OAXAPgEAAD84BcA+AQAAPzgFwD4BAAA/OAXAPgEAAD84BcA+X5JxPySNeD4rGyc5cAqAPisbJzlwCoA+AQAAP3IKgD4BAAA/cgqAPgEAAD9yCoA+AQAAP3IKgD5eknE/QkvaPqIcJzlUHwA+ohwnOVQfAD4BAAA/VB8APgEAAD9UHwA+AQAAP1QfAD4BAAA/VB8APgAAAD8s+F8/AAAAPyz4Xz8AAAA/LPhfPwAAAD8s+F8/AAAAP4/1fz8AAAA/j/V/PwEAAD8AECc5AQAAPwAQJzkAAAA/yPo/PwAAAD/I+j8/AAAAP8j6Pz8AAAA/yPo/PwAAAD9k/R8/AAAAP2T9Hz8AAAA/ZP0fPwAAAD9k/R8/AQAAPwAAAD8BAAA/AAAAPwEAAD8AAAA/AQAAPwAAAD8BAAA/OAXAPgEAAD84BcA+AQAAPzgFwD4BAAA/OAXAPgEAAD9yCoA+AQAAP3IKgD4BAAA/cgqAPgEAAD9yCoA+AQAAP1QfAD4BAAA/VB8APgEAAD9UHwA+AQAAP1QfAD52UiE/jvV/PwAAAD8s+F8/AAAAPyz4Xz/OVFA/jvV/PwAAAD+P9X8/AQAAPwAQJznlFAA//rdePwAAAD/I+j8/AAAAP8j6Pz/lFAA/prUvPwAAAD9k/R8/AAAAP2T9Hz91UiE/FHgOPwEAAD8AAAA/AQAAPwAAAD/NVFA/FHgOPwEAAD84BcA+AQAAPzgFwD5eknE/pbUvPwEAAD9yCoA+AQAAP3IKgD5fknE//bdePwEAAD9UHwA+AQAAP1QfAD4="),
"format": 34359742487,
"index_count": 180,
"index_data": PackedByteArray("AQALAAQAAQAIAAsACQAUAA0ACQAQABQADwAbABMADwAXABsAFgAgABkAFgAdACAAHgAnACIAHgAkACcAJQAvACkAJQArAC8AEgA7AAwAEgBDADsALAA3ADAALAAzADcAMgAGADUAMgACAAYAMQAHAAAABwAVAA4AFQAjABwAIwAxACoAMQAVAAcAFQAxACMAUABpAE4AUABrAGkAJgBLACEAJgBNAEsABQBVADQABQA/AFUACgA9AAMACgA5AD0AGgBCABEAGgBHAEIALQBPACgALQBSAE8AHwBFABgAHwBJAEUANgBTAC4ANgBXAFMAXgBbAFgAWwBqAG0AagBkAGcAZABeAGEAXgBqAFsAagBeAGQASABiAEQASABlAGIAQQBaADoAQQBgAFoAVgBsAFEAVgBvAGwATABmAEoATABoAGYARgBfAEAARgBjAF8AOABcADwAOABZAFwAPgBuAFQAPgBdAG4A"),
"lods": [0.0176836, PackedByteArray("AQBcAAMAAQAIAFwACABAAFwAQABfAFwACAAPAEAADwAWAEAAFgAdAEAAaABfAEAAHQBoAEAAHQAkAGgAJAArAGgAKwBuAGgAKwAyAG4AMgAFAG4ABQBdAG4AMgACAAUAMQAHAAAAMQAVAAcABwAVAA4AFQAxACMAIwAxACoAFQAjABwAWwBnAG0AXgBnAFsA"), 0.0191346, PackedByteArray("AQAPAAMADwBAAAMAQABcAAMAQABfAFwADwArAEAAaABfAEAAKwBoAEAAKwAFAGgABQBdAGgAKwACAAUAKgAOAAAAXgBnAFsA"), 0.0400226, PackedByteArray("AQArAAMAKwBoAAMAaABcAAMAKwAFAGgABQBdAGgAKwACAAUA")],
"material": SubResource("StandardMaterial3D_mfpbf"),
"name": "bullet",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 112,
"vertex_data": PackedByteArray("AAAAAM4fjb2do9G8AAAAAM4fjb2do9G8AAAAAM4fjb2do9G8AAAAALkAIT+Mo9G8AAAAALkAIT+Mo9G8AAAAALkAIT+Mo9G8AAAAALkAIT+Mo9G8sDyUPM4fjb3BPJS8sDyUPM4fjb3BPJS8sDyUPM4fjb3BPJS8sDyUPLkAIT+wPJS8sDyUPLkAIT+wPJS8sDyUPLkAIT+wPJS8sDyUPLkAIT+wPJS8jKPRPM4fjb0iqQmzjKPRPM4fjb0iqQmzjKPRPM4fjb0iqQmzjKPRPLkAIT8AAACAjKPRPLkAIT8AAACAjKPRPLkAIT8AAACAjKPRPLkAIT8AAACAsDyUPM4fjb2fPJQ8sDyUPM4fjb2fPJQ8sDyUPM4fjb2fPJQ8sDyUPLkAIT+wPJQ8sDyUPLkAIT+wPJQ8sDyUPLkAIT+wPJQ8sDyUPLkAIT+wPJQ8AAAAAM4fjb17o9E8AAAAAM4fjb17o9E8AAAAAM4fjb17o9E8AAAAALkAIT+Mo9E8AAAAALkAIT+Mo9E8AAAAALkAIT+Mo9E8AAAAALkAIT+Mo9E8sDyUvM4fjb2fPJQ8sDyUvM4fjb2fPJQ8sDyUvM4fjb2fPJQ8sDyUvLkAIT+wPJQ8sDyUvLkAIT+wPJQ8sDyUvLkAIT+wPJQ8sDyUvLkAIT+wPJQ8jKPRvM4fjb0iqQmzjKPRvM4fjb0iqQmzjKPRvM4fjb0iqQmzjKPRvLkAIT8AAACAjKPRvLkAIT8AAACAjKPRvLkAIT8AAACAjKPRvLkAIT8AAACAsDyUvM4fjb3BPJS8sDyUvM4fjb3BPJS8sDyUvM4fjb3BPJS8sDyUvLkAIT+wPJS8sDyUvLkAIT+wPJS8sDyUvLkAIT+wPJS8sDyUvLkAIT+wPJS8nSBDPJymJz+cIEO8nSBDPJymJz+cIEO8nSBDPJymJz+cIEO8nSBDPJymJz+cIEO8AAAAAJymJz/V+Ym8AAAAAJymJz/V+Ym8AAAAAJymJz/V+Ym8AAAAAJymJz/V+Ym81fmJPJymJz9PL4Iv1fmJPJymJz9PL4Iv1fmJPJymJz9PL4Iv1fmJPJymJz9PL4IvnSBDPJymJz+eIEM8nSBDPJymJz+eIEM8nSBDPJymJz+eIEM8nSBDPJymJz+eIEM8AAAAAJymJz/V+Yk8AAAAAJymJz/V+Yk8AAAAAJymJz/V+Yk8AAAAAJymJz/V+Yk8nSBDvJymJz+eIEM8nSBDvJymJz+eIEM8nSBDvJymJz+eIEM8nSBDvJymJz+eIEM81fmJvJymJz9PL4Iv1fmJvJymJz9PL4Iv1fmJvJymJz9PL4Iv1fmJvJymJz9PL4IvnSBDvJymJz+cIEO8nSBDvJymJz+cIEO8nSBDvJymJz+cIEO8nSBDvJymJz+cIEO8bdeSO6uXKj9r15K7bdeSO6uXKj9r15K7bdeSO6uXKj9r15K7tqyfLquXKj9Mqs+7tqyfLquXKj9Mqs+7tqyfLquXKj9Mqs+7TqrPO6uXKj+nU1AwTqrPO6uXKj+nU1AwTqrPO6uXKj+nU1AwbdeSO6uXKj9v15I7bdeSO6uXKj9v15I7bdeSO6uXKj9v15I7tqyfLquXKj9Qqs87tqyfLquXKj9Qqs87tqyfLquXKj9Qqs87bdeSu6uXKj9v15I7bdeSu6uXKj9v15I7bdeSu6uXKj9v15I7TqrPu6uXKj+nU1AwTqrPu6uXKj+nU1AwTqrPu6uXKj+nU1AwbdeSu6uXKj9r15K7bdeSu6uXKj9r15K7bdeSu6uXKj9r15K7/38AAAAAQS3//4Ha/3///wAAgdr/f///Xue34f///7///4Ha/3///6AYt+H///+/AACB2v9/////fwAAAABBLf//gdr/f/////99pf9///9e57fh////v///gdr/f///Xufntv///7///32l/3////9/AAAAAEEtgdr/f/9//////32l/3///xfJn5j///8/Xufntv///7+B2v9//3//////faX/f////38AAAAAQS19pf9//3///4Ha/3//f///Rp6fmP///z99pf9//3///xfJn5j///8/gdr/f/9/////fwAAAABBLX2l/3//f///gVr/f/9///9Gnp+Y////P32l/3//f///uGGfmP///z+BWv9//3////9/AAAAAEEtgVr/f/9///99Jf9//3///7hhn5j///8/gVr/f/9////nNp+Y////P30l/3//f////38AAAAAQS19Jf9//3///wAAfaX/f///5zafmP///z+gGOe2////v30l/3//f///AAB9pf9/////fwAAAABBLQAAgdr/f///AAB9pf9///+gGLfh////vwAAgdr/f///oBjntv///78AAH2l/3///73NOen///+/Xue34f///7+9zQfJ////v17n57b///+/vc056f///79e57fh////v0EyOen///+/oBi34f///7/3tkGy////P73NB8n///+/F8mfmP///z9e5+e2////v8WWQbL///8/Rp6fmP///z/3tkGy////PxfJn5j///8/xZZBsv///z9Gnp+Y////PzlpQbL///8/uGGfmP///z85aUGy////P7hhn5j///8/B0lBsv///z/nNp+Y////PwdJQbL///8/QTIHyf///7/nNp+Y////P6AY57b///+/QTI56f///7+gGLfh////v0EyB8n///+/oBjntv///7//f///AAC90r3NOen///+/vc0Hyf///7//f///AAC90r3NOen///+/QTI56f///7//f///AAC90ve2QbL///8/vc0Hyf///7//f///AAC90sWWQbL///8/97ZBsv///z//f///AAC90sWWQbL///8/OWlBsv///z//f///AAC90jlpQbL///8/B0lBsv///z//f///AAC90gdJQbL///8/QTIHyf///7//f///AAC90kEyOen///+/QTIHyf///78=")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_dtlcm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_x6v7s"]
transparency = 1
blend_mode = 1
albedo_color = Color(0.75476, 0.726851, 0.555583, 1)
emission_enabled = true
emission = Color(0.944624, 0.755365, 0, 1)
emission_energy_multiplier = 8.0
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_3wvag"]
direction = Vector3(0, 0, 1)
initial_velocity_min = 3.0
initial_velocity_max = 5.0
[sub_resource type="BoxMesh" id="BoxMesh_jrtee"]
size = Vector3(0.04, 0.04, 0.04)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ywt21"]
transparency = 1
blend_mode = 1
albedo_color = Color(0.383052, 0.264096, 0.213327, 1)
emission_enabled = true
emission = Color(0.737886, 0.150238, 0.0835467, 1)
emission_energy_multiplier = 8.0
[sub_resource type="CylinderShape3D" id="CylinderShape3D_tqvit"]
height = 1.53305
radius = 0.055
[node name="Bullet" type="RigidBody3D"]
collision_layer = 0
collision_mask = 105
continuous_cd = true
contact_monitor = true
max_contacts_reported = 2
script = ExtResource("1_oj0f5")
[node name="Cylinder" type="MeshInstance3D" parent="."]
transform = Transform3D(-2, -3.01992e-07, 0, 0, 0, -2, 3.01992e-07, -2, 0, 1.46364e-07, 0, 0.627698)
cast_shadow = 0
mesh = SubResource("ArrayMesh_gi7r4")
skeleton = NodePath("")
[node name="GPUParticles3D" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.718767)
material_override = SubResource("StandardMaterial3D_x6v7s")
cast_shadow = 0
emitting = false
one_shot = true
explosiveness = 1.0
process_material = SubResource("ParticleProcessMaterial_3wvag")
draw_pass_1 = SubResource("BoxMesh_jrtee")
[node name="GPUParticlesEnemy" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.718767)
material_override = SubResource("StandardMaterial3D_ywt21")
cast_shadow = 0
emitting = false
one_shot = true
explosiveness = 1.0
process_material = SubResource("ParticleProcessMaterial_3wvag")
draw_pass_1 = SubResource("BoxMesh_jrtee")
[node name="Audio" type="Node" parent="."]
[node name="HitIndicator" type="AudioStreamPlayer" parent="Audio"]
stream = ExtResource("3_6j0l2")
[node name="BulletCollision" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
shape = SubResource("CylinderShape3D_tqvit")
[node name="RayCast3D" type="RayCast3D" parent="."]
target_position = Vector3(0, 0, -1)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="body_shape_entered" from="." to="." method="_on_body_shape_entered"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=4 uid="uid://dqhltdnqyg8ni"]
[gd_scene load_steps=13 format=4 uid="uid://dqhltdnqyg8ni"]
[ext_resource type="Script" path="res://scripts/bullet.gd" id="1_oj0f5"]
[ext_resource type="Texture2D" uid="uid://dqytegxsmb5kg" path="res://assets/Models/bullet.transparency.png" id="2_0ks2n"]
@@ -49,20 +49,18 @@ blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_dtlcm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_x6v7s"]
transparency = 1
blend_mode = 1
albedo_color = Color(0.75476, 0.726851, 0.555583, 1)
metallic = 1.0
emission_enabled = true
emission = Color(0.944624, 0.755365, 0, 1)
emission_energy_multiplier = 8.0
emission = Color(1, 0.607843, 0.364706, 1)
emission_energy_multiplier = 4.0
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_3wvag"]
direction = Vector3(0, 0, 1)
initial_velocity_min = 3.0
initial_velocity_max = 5.0
[sub_resource type="BoxMesh" id="BoxMesh_jrtee"]
size = Vector3(0.04, 0.04, 0.04)
[sub_resource type="BoxMesh" id="BoxMesh_qy3jk"]
size = Vector3(0.025, 0.025, 0.025)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ywt21"]
transparency = 1
@@ -72,34 +70,43 @@ emission_enabled = true
emission = Color(0.737886, 0.150238, 0.0835467, 1)
emission_energy_multiplier = 8.0
[node name="Bullet" type="Node3D"]
[sub_resource type="BoxMesh" id="BoxMesh_jrtee"]
size = Vector3(0.04, 0.04, 0.04)
[sub_resource type="CylinderShape3D" id="CylinderShape3D_tqvit"]
height = 1.5
radius = 0.055
[node name="Bullet" type="RigidBody3D"]
top_level = true
collision_layer = 0
collision_mask = 105
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
mass = 0.01
center_of_mass_mode = 1
continuous_cd = true
contact_monitor = true
max_contacts_reported = 3
script = ExtResource("1_oj0f5")
[node name="gunbullet1" type="Node3D" parent="."]
transform = Transform3D(-2, 0, -3.01992e-07, 0, 2, 0, 3.01992e-07, 0, -2, 0, 0, 0)
[node name="Cylinder" type="MeshInstance3D" parent="gunbullet1"]
transform = Transform3D(1, 0, 0, 0, 0, -1, 0, 1, 0, -2.57922e-08, 0, -0.313849)
[node name="Cylinder" type="MeshInstance3D" parent="."]
transform = Transform3D(-2, -3.01992e-07, 0, 0, 0, -2, 3.01992e-07, -2, 0, 1.46364e-07, 0, 0.627698)
cast_shadow = 0
mesh = SubResource("ArrayMesh_gi7r4")
skeleton = NodePath("")
[node name="RayCast3D" type="RayCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1.70846, 0.000340699, 0.0133128, 0.723808)
target_position = Vector3(0, 0, -2.5)
collision_mask = 105
hit_from_inside = true
collide_with_areas = true
[node name="GPUParticles3D" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.718767)
material_override = SubResource("StandardMaterial3D_x6v7s")
cast_shadow = 0
emitting = false
amount = 20
one_shot = true
explosiveness = 1.0
process_material = SubResource("ParticleProcessMaterial_3wvag")
draw_pass_1 = SubResource("BoxMesh_jrtee")
draw_pass_1 = SubResource("BoxMesh_qy3jk")
[node name="GPUParticlesEnemy" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.718767)
@@ -111,12 +118,19 @@ explosiveness = 1.0
process_material = SubResource("ParticleProcessMaterial_3wvag")
draw_pass_1 = SubResource("BoxMesh_jrtee")
[node name="Timer" type="Timer" parent="."]
wait_time = 10.0
one_shot = true
autostart = true
[node name="Audio" type="Node" parent="."]
[node name="HitIndicator" type="AudioStreamPlayer" parent="Audio"]
stream = ExtResource("3_6j0l2")
[node name="BulletCollision" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
shape = SubResource("CylinderShape3D_tqvit")
[node name="RayCast3D" type="RayCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.47877)
target_position = Vector3(0, 0, -3)
collision_mask = 105
collide_with_areas = true
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@@ -10,8 +10,8 @@ height = 0.121962
radius = 0.0314789
[node name="casing_2" type="RigidBody3D" groups=["scene_rigidbody", "spawned"]]
collision_layer = 0
collision_mask = 5
collision_layer = 32
collision_mask = 37
mass = 0.1
continuous_cd = true
contact_monitor = true

View File

@@ -9,7 +9,7 @@ dof_blur_near_transition = 4.0
dof_blur_amount = 0.2
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_m5ien"]
blend_mode = 1
blend_mode = 3
[sub_resource type="Animation" id="Animation_4scpm"]
resource_name = "whiteout"
@@ -25,7 +25,7 @@ tracks/0/keys = {
"times": PackedFloat32Array(0, 0.05),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
"values": [Color(1, 1, 1, 0), Color(0, 0, 0, 1)]
}
tracks/1/type = "method"
tracks/1/imported = false
@@ -58,14 +58,14 @@ fov = 15.0
target_position = Vector3(0, 0, -1)
[node name="Timer" type="Timer" parent="."]
wait_time = 0.2
wait_time = 0.25
one_shot = true
[node name="Whiteout" type="ColorRect" parent="."]
material = SubResource("CanvasItemMaterial_m5ien")
offset_right = 40.0
offset_bottom = 40.0
color = Color(1, 1, 1, 0)
color = Color(0.8, 0.8, 0.8, 0.2)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {

View File

@@ -301,7 +301,7 @@ tracks/4/keys = {
"times": PackedFloat32Array(0, 0.03, 0.1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [0.0, 20.0, 0.0]
"values": [0.0, 10.0, 0.0]
}
tracks/5/type = "value"
tracks/5/imported = false
@@ -404,7 +404,9 @@ _data = {
script = ExtResource("2_6i1l4")
gun_name = "Mac 10"
max_ammo = 30
start_mags = 300
bullet_damage = 2
bullet_speed = 300
bullet_drop = 0.01
random_spread_amt = 0.5
fire_pitch_scale_amt = 0.05

View File

@@ -13,7 +13,6 @@ normal_scale = 2.0
normal_texture = ExtResource("4_7t6g2")
ao_enabled = true
ao_texture = ExtResource("2_rhxpx")
heightmap_enabled = true
heightmap_deep_parallax = true
heightmap_min_layers = 8
heightmap_max_layers = 32

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=24 format=3 uid="uid://drwae3loscbw7"]
[gd_scene load_steps=27 format=3 uid="uid://drwae3loscbw7"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_x7wms"]
[ext_resource type="PackedScene" uid="uid://dcmno6wafk5hg" path="res://assets/dead_player.tscn" id="2_4hoys"]
@@ -15,7 +15,9 @@
[ext_resource type="AudioStream" uid="uid://bl8yg1d3bsxs3" path="res://assets/Audio/constant-natural-strong-wind-looping-SBA-300062687.wav" id="11_he7p5"]
[ext_resource type="AudioStream" uid="uid://cy150nsjqp7lt" path="res://assets/Audio/grunt-male-SBA-300282985.wav" id="12_f51u4"]
[ext_resource type="AudioStream" uid="uid://cwre1dq8gsvbg" path="res://assets/Audio/Foley Sports/Boxing/Gloves Block Intense.wav" id="12_qhd01"]
[ext_resource type="PackedScene" uid="uid://cfbwx2fsdp0b3" path="res://pause_menu.tscn" id="13_xrfwr"]
[ext_resource type="AudioStream" uid="uid://t50i483xmj3a" path="res://assets/Audio/Weapons/toy-click-spin-SBA-300071143.wav" id="14_pnsbm"]
[ext_resource type="Shader" path="res://assets/crtTest.gdshader" id="14_v5svg"]
[ext_resource type="AudioStream" uid="uid://c1e6vr2hndho7" path="res://assets/Audio/Weapons/Misc (Ammo Boxes, Holsters, Etc)/Kydex Unholster 002.wav" id="17_1fyjm"]
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_l5ga0"]
@@ -33,6 +35,30 @@ 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
shader_parameter/scanlines_opacity = 0.05
shader_parameter/scanlines_width = 0.5
shader_parameter/grille_opacity = 0.05
shader_parameter/resolution = Vector2(640, 480)
shader_parameter/pixelate = false
shader_parameter/roll = true
shader_parameter/roll_speed = 1.0
shader_parameter/roll_size = 11.0
shader_parameter/roll_variation = 2.8
shader_parameter/distort_intensity = 0.002
shader_parameter/noise_opacity = 0.015
shader_parameter/noise_speed = 5.0
shader_parameter/static_noise_intensity = 0.005
shader_parameter/aberration = 0.00300005
shader_parameter/brightness = 1.4
shader_parameter/discolor = true
shader_parameter/warp_amount = 0.0
shader_parameter/clip_warp = true
shader_parameter/vignette_intensity = 0.4
shader_parameter/vignette_opacity = 0.235
[sub_resource type="BoxShape3D" id="BoxShape3D_nfpjw"]
size = Vector3(3, 3.58057, 3)
@@ -41,7 +67,7 @@ radius = 7.0
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("weapon_holder") groups=["player"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.11359, 0)
collision_layer = 11
collision_layer = 6
collision_mask = 11
script = ExtResource("1_x7wms")
dead_player = ExtResource("2_4hoys")
@@ -72,7 +98,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.25, -0.85, -1.501)
script = ExtResource("3_405jc")
[node name="Camera3D" type="Camera3D" parent="Head/Recoil"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0341401, 0.111267)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0341401, -0.00371268)
current = true
[node name="WeaponHolder" type="Node3D" parent="Head/Recoil/Camera3D"]
@@ -94,7 +120,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"]
[node name="AmmoCounter" type="Label" parent="Head/Recoil/Camera3D" groups=["hud"]]
offset_right = 3840.0
offset_bottom = 2160.0
size_flags_horizontal = 3
@@ -106,7 +132,7 @@ vertical_alignment = 2
script = ExtResource("4_8cy44")
padding_amount = 0.025
[node name="StaminaCounter" type="Label" parent="Head/Recoil/Camera3D"]
[node name="StaminaCounter" type="Label" parent="Head/Recoil/Camera3D" groups=["hud"]]
offset_right = 3440.0
offset_bottom = 1440.0
size_flags_horizontal = 3
@@ -125,7 +151,7 @@ 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"]
[node name="Crosshair" type="TextureRect" parent="Head/Recoil/Camera3D" groups=["hud"]]
offset_right = 40.0
offset_bottom = 40.0
texture = ExtResource("6_5m60e")
@@ -133,13 +159,13 @@ script = ExtResource("7_pnp4a")
[node name="Hitmarker" type="TextureRect" parent="Head/Recoil/Camera3D"]
visible = false
offset_right = 40.0
offset_right = 49.285
offset_bottom = 40.0
texture = ExtResource("8_kupqh")
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.114122)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.462246)
target_position = Vector3(0, 0, -200)
collision_mask = 5
collide_with_areas = true
@@ -156,6 +182,17 @@ collide_with_areas = true
[node name="Kick" type="AudioStreamPlayer3D" parent="Head/Recoil/Camera3D/Audio"]
stream = ExtResource("12_qhd01")
[node name="PauseMenu" parent="Head/Recoil/Camera3D" instance=ExtResource("13_xrfwr")]
visible = false
offset_right = 0.0
offset_bottom = 0.0
[node name="crtFilter" type="ColorRect" parent="Head/Recoil/Camera3D"]
visible = false
material = SubResource("ShaderMaterial_ubnx7")
offset_right = 3840.0
offset_bottom = 2160.0
[node name="pick_up_detection" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 16

View File

@@ -1076,12 +1076,12 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0718293, 0)
script = ExtResource("2_7rsti")
gun_name = "Ye Ol' Revolver"
fire_mode = 1
fov_zoom_amt = 0.96
fov_zoom_amt = 0.97
recoil_amount = Vector3(0.5, 0.1, 0.1)
max_ammo = 6
bullet_damage = 5
bullet_force_mod = 10
bullet_speed = 200
bullet_speed = 1500
bullet_drop = 0.0
random_spread_amt = 0.1
chamber = NodePath("revolver1/Chamber")

View File

@@ -2,14 +2,5 @@ extends StaticBody3D
signal switch_hit()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func hit():
emit_signal("switch_hit")

View File

@@ -39,8 +39,7 @@ func _on_switch_changed() -> void:
else:
if door.door_open == true:
door.close()
#Otherwise follow standard switches
#Otherwise follow standard switches
elif switches_on == switches_needed:
print("switch check run with " + str(switches_on) + "switches on")
if door.door_open == false:
@@ -49,3 +48,13 @@ func _on_switch_changed() -> void:
print("switch check run with " + str(switches_on) + "switches on")
if door.door_open == true:
door.close()
#Otherwise follow standard switches
elif switches_on == switches_needed:
print("switch check run with " + str(switches_on) + "switches on")
if door.door_open == false:
door.open()
else:
print("switch check run with " + str(switches_on) + "switches on")
if door.door_open == true:
door.close()

229
pause_menu.gdshader Normal file
View File

@@ -0,0 +1,229 @@
/*
Shader from Godot Shaders - the free shader library.
godotshaders.com/shader/VHS-and-CRT-monitor-effect
This shader is under CC0 license. Feel free to use, improve and
change this shader according to your needs and consider sharing
the modified result to godotshaders.com.
*/
shader_type canvas_item;
//*** IMPORTANT! ***/
// - If you are using this shader to affect the node it is applied to set 'overlay' to false (unchecked in the instepctor).
// - If you are using this shader as an overlay, and want the shader to affect the nodes below in the Scene hierarchy,
// set 'overlay' to true (checked in the inspector).
// On Mac there is potentially a bug causing this to not work properly. If that is the case and you want to use the shader as an overlay
// change all "overlay ? SCREEN_TEXTURE : TEXTURE" to only "SCREEN_TEXTURE" on lines 129-140, and "vec2 uv = overlay ? warp(SCREEN_UV) : warp(UV);"
// to "vec2 uv = warp(SCREEN_UV);" on line 98.
uniform bool overlay = false;
uniform float scanlines_opacity : hint_range(0.0, 1.0) = 0.4;
uniform float scanlines_width : hint_range(0.0, 0.5) = 0.25;
uniform float grille_opacity : hint_range(0.0, 1.0) = 0.3;
uniform vec2 resolution = vec2(640.0, 480.0); // Set the number of rows and columns the texture will be divided in. Scanlines and grille will make a square based on these values
uniform bool pixelate = true; // Fill each square ("pixel") with a sampled color, creating a pixel look and a more accurate representation of how a CRT monitor would work.
uniform bool roll = true;
uniform float roll_speed = 8.0; // Positive values are down, negative are up
uniform float roll_size : hint_range(0.0, 100.0) = 15.0;
uniform float roll_variation : hint_range(0.1, 5.0) = 1.8; // This valie is not an exact science. You have to play around with the value to find a look you like. How this works is explained in the code below.
uniform float distort_intensity : hint_range(0.0, 0.2) = 0.05; // The distortion created by the rolling effect.
uniform float noise_opacity : hint_range(0.0, 1.0) = 0.4;
uniform float noise_speed = 5.0; // There is a movement in the noise pattern that can be hard to see first. This sets the speed of that movement.
uniform float static_noise_intensity : hint_range(0.0, 1.0) = 0.06;
uniform float aberration : hint_range(-1.0, 1.0) = 0.03; // Chromatic aberration, a distortion on each color channel.
uniform float brightness = 1.4; // When adding scanline gaps and grille the image can get very dark. Brightness tries to compensate for that.
uniform bool discolor = true; // Add a discolor effect simulating a VHS
uniform float warp_amount :hint_range(0.0, 5.0) = 1.0; // Warp the texture edges simulating the curved glass of a CRT monitor or old TV.
uniform bool clip_warp = false;
uniform float vignette_intensity = 0.4; // Size of the vignette, how far towards the middle it should go.
uniform float vignette_opacity : hint_range(0.0, 1.0) = 0.5;
// Used by the noise functin to generate a pseudo random value between 0.0 and 1.0
vec2 random(vec2 uv){
uv = vec2( dot(uv, vec2(127.1,311.7) ),
dot(uv, vec2(269.5,183.3) ) );
return -1.0 + 2.0 * fract(sin(uv) * 43758.5453123);
}
// Generate a Perlin noise used by the distortion effects
float noise(vec2 uv) {
vec2 uv_index = floor(uv);
vec2 uv_fract = fract(uv);
vec2 blur = smoothstep(0.0, 1.0, uv_fract);
return mix( mix( dot( random(uv_index + vec2(0.0,0.0) ), uv_fract - vec2(0.0,0.0) ),
dot( random(uv_index + vec2(1.0,0.0) ), uv_fract - vec2(1.0,0.0) ), blur.x),
mix( dot( random(uv_index + vec2(0.0,1.0) ), uv_fract - vec2(0.0,1.0) ),
dot( random(uv_index + vec2(1.0,1.0) ), uv_fract - vec2(1.0,1.0) ), blur.x), blur.y) * 0.5 + 0.5;
}
// Takes in the UV and warps the edges, creating the spherized effect
vec2 warp(vec2 uv){
vec2 delta = uv - 0.5;
float delta2 = dot(delta.xy, delta.xy);
float delta4 = delta2 * delta2;
float delta_offset = delta4 * warp_amount;
return uv + delta * delta_offset;
}
// Adds a black border to hide stretched pixel created by the warp effect
float border (vec2 uv){
float radius = min(warp_amount, 0.08);
radius = max(min(min(abs(radius * 2.0), abs(1.0)), abs(1.0)), 1e-5);
vec2 abs_uv = abs(uv * 2.0 - 1.0) - vec2(1.0, 1.0) + radius;
float dist = length(max(vec2(0.0), abs_uv)) / radius;
float square = smoothstep(0.96, 1.0, dist);
return clamp(1.0 - square, 0.0, 1.0);
}
// Adds a vignette shadow to the edges of the image
float vignette(vec2 uv){
uv *= 1.0 - uv.xy;
float vignette = uv.x * uv.y * 15.0;
return pow(vignette, vignette_intensity * vignette_opacity);
}
void fragment()
{
vec2 uv = overlay ? warp(SCREEN_UV) : warp(UV); // Warp the uv. uv will be used in most cases instead of UV to keep the warping
vec2 text_uv = uv;
vec2 roll_uv = vec2(0.0);
float time = roll ? TIME : 0.0;
// Pixelate the texture based on the given resolution.
if (pixelate)
{
text_uv = ceil(uv * resolution) / resolution;
}
// Create the rolling effect. We need roll_line a bit later to make the noise effect.
// That is why this runs if roll is true OR noise_opacity is over 0.
float roll_line = 0.0;
if (roll || noise_opacity > 0.0)
{
// Create the areas/lines where the texture will be distorted.
roll_line = smoothstep(0.3, 0.9, sin(uv.y * roll_size - (time * roll_speed) ) );
// Create more lines of a different size and apply to the first set of lines. This creates a bit of variation.
roll_line *= roll_line * smoothstep(0.3, 0.9, sin(uv.y * roll_size * roll_variation - (time * roll_speed * roll_variation) ) );
// Distort the UV where where the lines are
roll_uv = vec2(( roll_line * distort_intensity * (1.-UV.x)), 0.0);
}
vec4 text;
if (roll)
{
// If roll is true distort the texture with roll_uv. The texture is split up into RGB to
// make some chromatic aberration. We apply the aberration to the red and green channels accorging to the aberration parameter
// and intensify it a bit in the roll distortion.
text.r = texture(SCREEN_TEXTURE, text_uv + roll_uv * 0.8 + vec2(aberration, 0.0) * .1).r;
text.g = texture(SCREEN_TEXTURE, text_uv + roll_uv * 1.2 - vec2(aberration, 0.0) * .1 ).g;
text.b = texture(SCREEN_TEXTURE, text_uv + roll_uv).b;
text.a = 1.0;
}
else
{
// If roll is false only apply the aberration without any distorion. The aberration values are very small so the .1 is only
// to make the slider in the Inspector less sensitive.
text.r = texture(SCREEN_TEXTURE, text_uv + vec2(aberration, 0.0) * .1).r;
text.g = texture(SCREEN_TEXTURE, text_uv - vec2(aberration, 0.0) * .1).g;
text.b = texture(SCREEN_TEXTURE, text_uv).b;
text.a = 1.0;
}
float r = text.r;
float g = text.g;
float b = text.b;
uv = warp(UV);
// CRT monitors don't have pixels but groups of red, green and blue dots or lines, called grille. We isolate the texture's color channels
// and divide it up in 3 offsetted lines to show the red, green and blue colors next to each other, with a small black gap between.
if (grille_opacity > 0.0){
float g_r = smoothstep(0.85, 0.95, abs(sin(uv.x * (resolution.x * 3.14159265))));
r = mix(r, r * g_r, grille_opacity);
float g_g = smoothstep(0.85, 0.95, abs(sin(1.05 + uv.x * (resolution.x * 3.14159265))));
g = mix(g, g * g_g, grille_opacity);
float b_b = smoothstep(0.85, 0.95, abs(sin(2.1 + uv.x * (resolution.x * 3.14159265))));
b = mix(b, b * b_b, grille_opacity);
}
// Apply the grille to the texture's color channels and apply Brightness. Since the grille and the scanlines (below) make the image very dark you
// can compensate by increasing the brightness.
text.r = clamp(r * brightness, 0.0, 1.0);
text.g = clamp(g * brightness, 0.0, 1.0);
text.b = clamp(b * brightness, 0.0, 1.0);
// Scanlines are the horizontal lines that make up the image on a CRT monitor.
// Here we are actual setting the black gap between each line, which I guess is not the right definition of the word, but you get the idea
float scanlines = 0.5;
if (scanlines_opacity > 0.0)
{
// Same technique as above, create lines with sine and applying it to the texture. Smoothstep to allow setting the line size.
scanlines = smoothstep(scanlines_width, scanlines_width + 0.5, abs(sin(uv.y * (resolution.y * 3.14159265))));
text.rgb = mix(text.rgb, text.rgb * vec3(scanlines), scanlines_opacity);
}
// Apply the banded noise.
if (noise_opacity > 0.0)
{
// Generate a noise pattern that is very stretched horizontally, and animate it with noise_speed
float noise = smoothstep(0.4, 0.5, noise(uv * vec2(2.0, 200.0) + vec2(10.0, (TIME * (noise_speed))) ) );
// We use roll_line (set above) to define how big the noise should be vertically (multiplying cuts off all black parts).
// We also add in some basic noise with random() to break up the noise pattern above. The noise is sized according to
// the resolution value set in the inspector. If you don't like this look you can
// change "ceil(uv * resolution) / resolution" to only "uv" to make it less pixelated. Or multiply resolution with som value
// greater than 1.0 to make them smaller.
roll_line *= noise * scanlines * clamp(random((ceil(uv * resolution) / resolution) + vec2(TIME * 0.8, 0.0)).x + 0.8, 0.0, 1.0);
// Add it to the texture based on noise_opacity
text.rgb = clamp(mix(text.rgb, text.rgb + roll_line, noise_opacity), vec3(0.0), vec3(1.0));
}
// Apply static noise by generating it over the whole screen in the same way as above
if (static_noise_intensity > 0.0)
{
text.rgb += clamp(random((ceil(uv * resolution) / resolution) + fract(TIME)).x, 0.0, 1.0) * static_noise_intensity;
}
// Apply a black border to hide imperfections caused by the warping.
// Also apply the vignette
text.rgb *= border(uv);
text.rgb *= vignette(uv);
// Hides the black border and make that area transparent. Good if you want to add the the texture on top an image of a TV or monitor.
if (clip_warp)
{
text.a = border(uv);
}
// Apply discoloration to get a VHS look (lower saturation and higher contrast)
// You can play with the values below or expose them in the Inspector.
float saturation = 0.5;
float contrast = 1.2;
if (discolor)
{
// Saturation
vec3 greyscale = vec3(text.r + text.g + text.b) / 3.;
text.rgb = mix(text.rgb, greyscale, saturation);
// Contrast
float midpoint = pow(0.5, 2.2);
text.rgb = (text.rgb - vec3(midpoint)) * contrast + midpoint;
}
COLOR = text;
}

105
pause_menu.tscn Normal file
View File

@@ -0,0 +1,105 @@
[gd_scene load_steps=6 format=3 uid="uid://cfbwx2fsdp0b3"]
[ext_resource type="Script" path="res://scripts/pause_menu.gd" id="1_57eae"]
[ext_resource type="Shader" path="res://assets/crtTest.gdshader" id="1_t8tc5"]
[ext_resource type="FontFile" uid="uid://d2h2tjhxiv5wo" path="res://assets/fonts/White On Black.ttf" id="3_4nq4f"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_62ipe"]
shader = ExtResource("1_t8tc5")
shader_parameter/overlay = true
shader_parameter/scanlines_opacity = 0.4
shader_parameter/scanlines_width = 0.25
shader_parameter/grille_opacity = 0.3
shader_parameter/resolution = Vector2(640, 480)
shader_parameter/pixelate = true
shader_parameter/roll = true
shader_parameter/roll_speed = 8.0
shader_parameter/roll_size = 15.0
shader_parameter/roll_variation = 1.8
shader_parameter/distort_intensity = 0.05
shader_parameter/noise_opacity = 0.4
shader_parameter/noise_speed = 5.0
shader_parameter/static_noise_intensity = 0.06
shader_parameter/aberration = 0.03
shader_parameter/brightness = 1.4
shader_parameter/discolor = true
shader_parameter/warp_amount = 1.0
shader_parameter/clip_warp = false
shader_parameter/vignette_intensity = 0.4
shader_parameter/vignette_opacity = 0.5
[sub_resource type="ShaderMaterial" id="ShaderMaterial_nsure"]
shader = ExtResource("1_t8tc5")
shader_parameter/overlay = true
shader_parameter/scanlines_opacity = 0.025
shader_parameter/scanlines_width = 0.315
shader_parameter/grille_opacity = 0.1
shader_parameter/resolution = Vector2(640, 480)
shader_parameter/pixelate = true
shader_parameter/roll = true
shader_parameter/roll_speed = 8.0
shader_parameter/roll_size = 15.0
shader_parameter/roll_variation = 1.8
shader_parameter/distort_intensity = 0.05
shader_parameter/noise_opacity = 0.4
shader_parameter/noise_speed = 5.0
shader_parameter/static_noise_intensity = 0.06
shader_parameter/aberration = 0.03
shader_parameter/brightness = 0.7
shader_parameter/discolor = true
shader_parameter/warp_amount = 0.0
shader_parameter/clip_warp = true
shader_parameter/vignette_intensity = 0.4
shader_parameter/vignette_opacity = 0.235
[node name="PauseMenu" type="Control"]
material = SubResource("ShaderMaterial_62ipe")
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = 2688.0
offset_bottom = 1512.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_57eae")
[node name="ColorRect" type="ColorRect" parent="."]
material = SubResource("ShaderMaterial_nsure")
layout_mode = 0
offset_right = 3840.0
offset_bottom = 2160.0
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -277.018
offset_top = -174.68
offset_right = 277.018
offset_bottom = 174.68
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
[node name="Resume" type="Button" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_fonts/font = ExtResource("3_4nq4f")
theme_override_font_sizes/font_size = 150
text = "Resume"
[node name="Save & Quit" type="Button" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_fonts/font = ExtResource("3_4nq4f")
theme_override_font_sizes/font_size = 150
text = "Save & Quit"
[connection signal="pressed" from="MarginContainer/VBoxContainer/Resume" to="." method="_on_resume_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/Save & Quit" to="." method="_on_save__quit_pressed"]

View File

@@ -41,6 +41,7 @@ scene_rigidbody=""
weight=""
switch_override=""
magnet=""
hud=""
[input]
@@ -134,6 +135,31 @@ kick={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":113,"location":0,"echo":false,"script":null)
]
}
numb_1={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"location":0,"echo":false,"script":null)
]
}
numb_2={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":50,"key_label":0,"unicode":50,"location":0,"echo":false,"script":null)
]
}
numb_3={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":51,"key_label":0,"unicode":51,"location":0,"echo":false,"script":null)
]
}
numb_4={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":52,"key_label":0,"unicode":52,"location":0,"echo":false,"script":null)
]
}
numb_5={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":53,"key_label":0,"unicode":53,"location":0,"echo":false,"script":null)
]
}
[layer_names]

110
scenes/bullet_test.tscn Normal file
View File

@@ -0,0 +1,110 @@
[gd_scene load_steps=15 format=3 uid="uid://dq3pqbjg7o241"]
[ext_resource type="Script" path="res://scripts/LevelManager.gd" id="1_iqxey"]
[ext_resource type="PackedScene" uid="uid://brl0bsqjl5dg3" path="res://assets/mac_10.tscn" id="2_bbv4q"]
[ext_resource type="Material" uid="uid://br2pyyyl2n3cx" path="res://assets/materials/prototype/prototype1.tres" id="3_ol40x"]
[ext_resource type="PackedScene" uid="uid://b5eclfg0cmmal" path="res://assets/revolver_1.tscn" id="3_tt31v"]
[ext_resource type="PackedScene" uid="uid://drwae3loscbw7" path="res://assets/player.tscn" id="4_1k4dj"]
[ext_resource type="PackedScene" uid="uid://cnfc8rtk6l1d8" path="res://assets/crate1.tscn" id="6_4jfab"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_s7a4u"]
sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
[sub_resource type="Sky" id="Sky_c52rg"]
sky_material = SubResource("ProceduralSkyMaterial_s7a4u")
[sub_resource type="Environment" id="Environment_c1yeo"]
background_mode = 2
sky = SubResource("Sky_c52rg")
tonemap_mode = 2
ssao_enabled = true
sdfgi_enabled = true
glow_enabled = true
[sub_resource type="BoxMesh" id="BoxMesh_fi4o8"]
[sub_resource type="BoxShape3D" id="BoxShape3D_1u1id"]
[sub_resource type="Animation" id="Animation_qlawa"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(6.78104, 1.26555, -18.3016)]
}
[sub_resource type="Animation" id="Animation_l1fwm"]
resource_name = "new_animation"
length = 7.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.0105508, 0.7, 1.9, 3.96, 4.16, 4.75514),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 0,
"values": [Vector3(6.78104, 1.26555, -18.3016), Vector3(6.78104, 8.4087, -18.3016), Vector3(-4.99932, 8.4087, -18.3016), Vector3(21.2047, 8.4087, -18.3016), Vector3(21.2047, 8.4087, -18.3016), Vector3(21.2047, 8.4087, 16.4439)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dlky4"]
_data = {
"RESET": SubResource("Animation_qlawa"),
"new_animation": SubResource("Animation_l1fwm")
}
[node name="BulletTest" type="Node3D" node_paths=PackedStringArray("player")]
script = ExtResource("1_iqxey")
player = NodePath("Player")
gun_1 = ExtResource("2_bbv4q")
gun_2 = ExtResource("3_tt31v")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_c1yeo")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.614285, -0.683367, 0.394542, 0, 0.5, 0.866025, -0.789084, -0.531987, 0.307143, 0, 0, 0)
shadow_enabled = true
[node name="CSGBox3D2" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -20.2065, 1.06369, -8.35413)
use_collision = true
size = Vector3(9.58691, 1.80511, 9.50757)
material = ExtResource("3_ol40x")
[node name="CSGBox3D" type="CSGBox3D" parent="."]
use_collision = true
size = Vector3(50, 0.5, 50)
material = ExtResource("3_ol40x")
[node name="Player" parent="." instance=ExtResource("4_1k4dj")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.93316, 1.36359, 21.3029)
[node name="AnimatableBody3D" type="AnimatableBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.78104, 1.26555, -18.3016)
[node name="MeshInstance3D" type="MeshInstance3D" parent="AnimatableBody3D"]
mesh = SubResource("BoxMesh_fi4o8")
[node name="CollisionShape3D" type="CollisionShape3D" parent="AnimatableBody3D"]
shape = SubResource("BoxShape3D_1u1id")
[node name="AnimationPlayer" type="AnimationPlayer" parent="AnimatableBody3D"]
libraries = {
"": SubResource("AnimationLibrary_dlky4")
}
autoplay = "new_animation"
[node name="Crate1" parent="." instance=ExtResource("6_4jfab")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 17.8157, 3.08948, -17.9593)

View File

@@ -21,6 +21,7 @@ var dead_player = preload("res://assets/dead_cam.tscn")
const CLEARED_ANNOUNCE = preload("res://assets/cleared_announce.tscn")
const DEAD_ANNOUNCE = preload("res://assets/dead_announce.tscn")
var paused = false
var health = start_health
var pickups = []
var held_guns = []
@@ -36,6 +37,7 @@ var last_hit : Node
var respawn_position
var respawn_cam_rotation
var respawn_rot
var engine_time_scale_cache : float = 1.0
# Called when the node enters the scene tree for the first time.
func _ready():
@@ -86,7 +88,9 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
pass
#quit game and eventually go to menu
if Input.is_action_just_pressed("escape"):
pause_menu()
@@ -141,6 +145,7 @@ func die():
get_tree().get_root().add_child(instance_dead)
instance_dead.camera.current = true
player.dead = true
player.toggle_hud(true)
player.gun.visible = false
player.crosshair.visible = false
@@ -151,3 +156,21 @@ func pickup_spawn():
#var item_name = item_type[1][0]
item_spawn.rand_amt = randi_range(25,100)
return item_spawn
func pause_menu():
if paused:
Engine.time_scale = engine_time_scale_cache
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
player.toggle_hud(true)
player.pause_menu.hide()
else:
engine_time_scale_cache = Engine.time_scale
Engine.time_scale = 0
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
player.toggle_hud(false)
player.pause_menu.show()
paused = !paused
func save_quit():
get_tree().quit()

View File

@@ -1,4 +1,4 @@
extends Node3D
extends RigidBody3D
var bullet_speed
var bullet_drop
@@ -9,75 +9,63 @@ var bullet_force_mod = 1.0
var distance_from_player
var player_position
var player_velocity
var bullet_active = true
@onready var mesh = $gunbullet1
@onready var ray = $RayCast3D
@onready var mesh = $Cylinder
@onready var particles = $GPUParticles3D
@onready var enemy_particles = $GPUParticlesEnemy
@onready var timer = $Timer
@onready var gunbullet1 = $gunbullet1/Cylinder
@onready var hit_indicator = $Audio/HitIndicator
@onready var ray: RayCast3D = $RayCast3D
var rng = RandomNumberGenerator.new()
var av_x
var av_y
var av_z
# Called when the node enters the scene tree for the first time.
func _ready():
#apply random rotation
av_x = deg_to_rad(rng.randf_range(-random_spread_amt,random_spread_amt))
av_y = deg_to_rad(rng.randf_range(-random_spread_amt,random_spread_amt))
av_z = deg_to_rad(rng.randf_range(-random_spread_amt,random_spread_amt))
rotation += Vector3(av_x,av_y,av_z)
timer.start()
visible = false
ray.target_position.z *= (bullet_speed/150)
linear_velocity += transform.basis * Vector3(0, 0, -bullet_speed)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
position += transform.basis * Vector3(0, 0, -bullet_speed) * delta
rotation.x = clamp(rotation.x - delta * bullet_drop,deg_to_rad(-90),deg_to_rad(90))
angular_velocity = Vector3(0,0,0)
distance_from_player = abs(self.global_position - player_position)
if distance_from_player.x > 2 or distance_from_player.y > 2 or distance_from_player.z > 2:
if distance_from_player.length() > 1.5:
visible = true
if ray.is_colliding() and !ray.get_collider().is_in_group("player"):
func _on_body_entered(body: Node) -> void:
if !body.is_in_group("player") and bullet_active:
print("BODY HIT - " + str(body))
#Break Breakable Objects
if body.is_in_group("breakable"):
body.breaking(linear_velocity)
if body.is_in_group("switch"):
body.hit()
if ray.is_colliding() and !ray.get_collider().is_in_group("player"):
#Bullet Hole Effect
ray.get_collider().add_child(instance_bullethole)
instance_bullethole.global_transform.origin = ray.get_collision_point()
if (abs(ray.get_collision_normal().y) > 0.99):
instance_bullethole.look_at(ray.get_collision_point() + ray.get_collision_normal(), Vector3(0,0,1))
else:
instance_bullethole.look_at(ray.get_collision_point() + ray.get_collision_normal())
#Hit Enemies
if ray.get_collider().is_in_group("enemy_target"):
hit_indicator.play()
enemy_particles.emitting = true
SignalBus.emit_signal("enemy_hit")
ray.get_collider().hit(bullet_damage)
mesh.visible = false
ray.enabled = false
#bullethole effect
ray.get_collider().add_child(instance_bullethole)
instance_bullethole.global_transform.origin = ray.get_collision_point()
if (abs(ray.get_collision_normal().y) > 0.99):
instance_bullethole.look_at(ray.get_collision_point() + ray.get_collision_normal(), Vector3(0,0,1))
else:
instance_bullethole.look_at(ray.get_collision_point() + ray.get_collision_normal())
#move rigidbodies
if ray.get_collider().is_in_group("scene_rigidbody"):
ray.get_collider().linear_velocity += transform.basis * Vector3(0,0,-1 * bullet_force_mod)
if ray.get_collider().is_in_group("breakable"):
var current_velocity = transform.basis * Vector3(0,0,-1 * bullet_force_mod)
ray.get_collider().breaking(current_velocity)
if ray.get_collider().is_in_group("enemy_target"):
hit_indicator.play()
enemy_particles.emitting = true
ray.get_collider().hit(bullet_damage)
if ray.get_collider().is_in_group("switch"):
ray.get_collider().hit()
await get_tree().create_timer(1.0).timeout
bullet_active = false
particles.emitting = true
await get_tree().create_timer(1).timeout
queue_free()

View File

@@ -1,5 +1,7 @@
extends Node3D
const recoil_amount : Vector3 = Vector3(.5,.1,.1)
var bullet_speed
var bullet_drop
var random_spread_amt
@@ -42,7 +44,10 @@ func _process(delta):
if ray.is_colliding() and ray.get_collider() != null:
if ray.get_collider().is_in_group("player"):
var player = ray.get_collider()
var snap_amount = 10
var speed_amount = 10
player.level_control.health -= bullet_damage
player.recoil.add_recoil(recoil_amount,snap_amount,speed_amount)
if player.level_control.health <= bullet_damage:
player.level_control.last_hit = fired_by

View File

@@ -73,14 +73,7 @@ func _process(delta):
camera.fov = lerp(camera.fov, 40.0, delta * 5)
elif respawn == true:
position = lerp(position,respawn_position,delta * MOVE_SPEED)
camera.global_transform.basis = lerp(camera.global_transform.basis,respawn_rotation,delta * CAMERA_LOOK_SPEED * 1.5)
camera.fov = lerp(camera.fov, respawn_fov, delta * 10)
if global_position.distance_to(respawn_position) <= .5:
animation_player.play("whiteout")
if Input.is_action_just_pressed("escape"):
get_tree().quit()
animation_player.play("whiteout")
func _on_timer_timeout():

View File

@@ -11,6 +11,7 @@ var taunts = ["hows your gut now you big cup of dumdum juice?",
"hee hee",
"stop trying",
"you got hit with my bullet",
"try dodging it next time",
"yowza!"]
# Called when the node enters the scene tree for the first time.

View File

@@ -104,14 +104,14 @@ func shoot(delta):
instance_bullet.bullet_force_mod = bullet_force_mod
instance_bullet.instance_bullethole = bullethole.instantiate()
instance_bullet.player_position = player.global_position
get_tree().get_root().add_child(instance_bullet)
get_tree().current_scene.add_child(instance_bullet)
# Casing transform
var instance_casing = casing.instantiate()
instance_casing.position = casing_ejector.global_position
instance_casing.transform.basis = casing_ejector.global_transform.basis
get_tree().get_root().add_child(instance_casing)
player.recoil.add_recoil(recoil_amount)
player.recoil.add_recoil(recoil_amount,10,10)
if fire_mode != 0:
cycle_count -= 1

20
scripts/pause_menu.gd Normal file
View File

@@ -0,0 +1,20 @@
extends Control
@onready var level_control = get_tree().current_scene
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
visible = false
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_resume_pressed() -> void:
level_control.pause_menu()
func _on_save__quit_pressed() -> void:
level_control.save_quit()

View File

@@ -8,7 +8,7 @@ const LAND_CAMERA_TILT : Vector3 = Vector3(-1,0,0)
const WALK_SPEED = 12.0
const SPRINT_SPEED = 15.0
const DASH_SPEED = 40
const SLOWSPEED = .2
const SLOWSPEED = .15
const STAMINA_DRAIN = 100
var speed
@@ -51,6 +51,7 @@ var start_sensitivity
var gun : Node
@onready var pause_menu: Control = $Head/Recoil/Camera3D/PauseMenu
@onready var gun_ray = $Head/Recoil/Camera3D/GunRay
@onready var level_control = get_tree().current_scene
@onready var interact_ray = $Head/Recoil/Camera3D/InteractRay
@@ -72,6 +73,7 @@ var gun_fire_pitch_starting
var current_weapon_index
var recoiling = false
var dead = false
var hud_visible : bool = true
# Slow Down Variables
var remaining_stamina = MAX_STAMINA
@@ -83,6 +85,7 @@ var dead_announce = load("res://assets/dead_announce.tscn")
var pickupmsg
@onready var crosshair = $Head/Recoil/Camera3D/Crosshair
@onready var hitmarker: TextureRect = $Head/Recoil/Camera3D/Hitmarker
@onready var head = $Head
@onready var camera = $Head/Recoil/Camera3D
@onready var world_environment = $"../WorldEnvironment"
@@ -101,10 +104,13 @@ var pickupmsg
@onready var flashlight_audio: AudioStreamPlayer3D = $Head/Recoil/Camera3D/WeaponHolder/FlashlightButton
@onready var kick_audio: AudioStreamPlayer3D = $Head/Recoil/Camera3D/Audio/Kick
@onready var weapon_pickup_audio: AudioStreamPlayer = $Audio/WeaponPickup
@onready var crt_filter: ColorRect = $Head/Recoil/Camera3D/crtFilter
func _ready():
SignalBus.enemy_hit.connect(enemy_hit)
weapon_holder_start_rot = weapon_holder.rotation
weapon_holder_start_pos = weapon_holder.position
@@ -121,15 +127,23 @@ func _ready():
AudioServer.set_bus_volume_db(0,-80)
func _input(event) -> void:
if event is InputEventMouseMotion:
self.rotate_y(-event.relative.x * SENSITIVITY)
head.rotate_x(-event.relative.y * SENSITIVITY)
head.rotation.x = clamp(head.rotation.x, deg_to_rad(-90), deg_to_rad(85))
mouse_input = event.relative
if !level_control.paused:
if event is InputEventMouseMotion:
self.rotate_y(-event.relative.x * SENSITIVITY)
head.rotate_x(-event.relative.y * SENSITIVITY)
head.rotation.x = clamp(head.rotation.x, deg_to_rad(-90), deg_to_rad(85))
mouse_input = event.relative
else:
if event is InputEventMouseMotion:
self.rotate_y(event.relative.x * .00001)
head.rotate_x(event.relative.y * .00001)
head.rotation.x = clamp(head.rotation.x, deg_to_rad(-90), deg_to_rad(85))
mouse_input = event.relative
func _physics_process(delta):
if !dead:
if !dead and !level_control.paused:
# Add the gravity.
if is_on_floor():
@@ -200,44 +214,46 @@ func _physics_process(delta):
#initiate fast movement -- may be done with this block
#change sounds with speed
if moving_fast:
var wind_volume = clamp( velocity.length() - 20 ,-20,10)
var wind_volume = clamp( velocity.length() - 20 ,-80,10)
ear_wind.volume_db = wind_volume
#reset at apex
#cache fastest speed
if abs(velocity.y) > moving_fast_top_speed:
moving_fast_top_speed = abs(velocity.y)
#print("TOP SPEED = " + str(moving_fast_top_speed))
#Land Sound
if velocity.y < .1 and self.is_on_floor() and moving_fast == true:
print("LAND SOUND")
var land_volume = clamp( moving_fast_top_speed - 20 ,-10,0)
var recoil_amount = Vector3(-.3,0,0)
land_sound.volume_db = land_volume
land_sound.play()
recoil.add_recoil(recoil_amount,10,2)
moving_fast_top_speed = 0.0
moving_fast = false
# Game Speed
if Input.is_action_pressed("slow_down") and remaining_stamina >0:
Engine.time_scale = lerp(0, 1, SLOWSPEED)
gun.random_spread_amt = 0
AudioServer.set_bus_effect_enabled(0,0,true)
camera.fov = lerp(camera.fov, camera.fov * gun.fov_zoom_amt, delta * 100)
if sensitivity_shift == true:
SENSITIVITY = lerp(SENSITIVITY, SENSITIVITY * .998, delta * 100)
if remaining_stamina >0:
remaining_stamina -= 1000 * delta
else:
Engine.time_scale = 1
gun.random_spread_amt = gun.random_spread_start
AudioServer.set_bus_effect_enabled(0,0,false)
if sensitivity_shift == true:
camera.fov = lerp(camera.fov, BASE_FOV, delta * .5)
SENSITIVITY = start_sensitivity
if remaining_stamina < MAX_STAMINA:
remaining_stamina += STAMINA_DRAIN * delta
elif remaining_stamina > MAX_STAMINA * 1.01:
remaining_stamina -= (STAMINA_DRAIN)/2 * delta
if !level_control.paused:
if Input.is_action_pressed("slow_down") and remaining_stamina >0:
Engine.time_scale = lerp(0, 1, SLOWSPEED)
gun.random_spread_amt = 0
AudioServer.set_bus_effect_enabled(0,0,true)
camera.fov = lerp(camera.fov, camera.fov * gun.fov_zoom_amt, delta * 100)
if sensitivity_shift == true:
SENSITIVITY = lerp(SENSITIVITY, SENSITIVITY * .998, delta * 100)
if remaining_stamina >0:
remaining_stamina -= 1000 * delta
else:
Engine.time_scale = 1
gun.random_spread_amt = gun.random_spread_start
AudioServer.set_bus_effect_enabled(0,0,false)
if sensitivity_shift == true:
camera.fov = lerp(camera.fov, BASE_FOV, delta * .5)
SENSITIVITY = start_sensitivity
if remaining_stamina < MAX_STAMINA:
remaining_stamina += STAMINA_DRAIN * delta
elif remaining_stamina > MAX_STAMINA * 1.01:
remaining_stamina -= (STAMINA_DRAIN)/2 * delta
# Reloading
if Input.is_action_just_pressed("reload"):
@@ -283,6 +299,22 @@ func _physics_process(delta):
gun.anim_player.play("swap_out")
level_control.gun_spawn(level_control.current_gun_index - 1)
# Weapon Swap Number 1
if Input.is_action_just_pressed("numb_1") and !gun.anim_player.is_playing():
weapon_select(0)
if Input.is_action_just_pressed("numb_2") and !gun.anim_player.is_playing():
weapon_select(1)
if Input.is_action_just_pressed("numb_3") and !gun.anim_player.is_playing():
weapon_select(2)
if Input.is_action_just_pressed("numb_4") and !gun.anim_player.is_playing():
weapon_select(3)
if Input.is_action_just_pressed("numb_5") and !gun.anim_player.is_playing():
weapon_select(4)
#interact button
if Input.is_action_just_pressed("interact"):
@@ -299,9 +331,7 @@ func _physics_process(delta):
kick_audio.play()
interact_ray.get_collider().linear_velocity += transform.basis * Vector3(0,0,-KICK_AMOUNT)
#quit game and eventually go to menu
if Input.is_action_just_pressed("escape"):
get_tree().quit()
if level_control.health <= 0:
level_control.die()
@@ -347,8 +377,8 @@ func weapon_tilt(input_x, delta):
func weapon_sway(delta):
mouse_input = lerp(mouse_input, Vector2.ZERO, 10 * delta)
weapon_holder.rotation.x = lerp(weapon_holder.rotation.x, mouse_input.y * weapon_sway_amount, 10 * delta)
weapon_holder.rotation.y = lerp(weapon_holder.rotation.y, mouse_input.x * weapon_sway_amount, 10 * delta)
weapon_holder.rotation.x = lerp(weapon_holder.rotation.x, mouse_input.y * weapon_sway_amount, 5 * delta)
weapon_holder.rotation.y = lerp(weapon_holder.rotation.y, mouse_input.x * weapon_sway_amount, 5 * delta)
func weapon_bob(vel : float, delta):
if weapon_holder:
@@ -361,5 +391,22 @@ func weapon_bob(vel : float, delta):
weapon_holder.position.y = lerp(weapon_holder.position.y, def_weapon_holder_pos.y, .1 * delta)
weapon_holder.position.x = lerp(weapon_holder.position.x, def_weapon_holder_pos.x, .1 * delta)
func weapon_recoil():
pass
func weapon_select(gun_id):
if level_control.held_guns.size() >= (gun_id + 1) and level_control.current_gun_index != gun_id:
gun.anim_player.play("swap_out")
level_control.gun_spawn(gun_id)
func enemy_hit():
hitmarker.visible = true
await get_tree().create_timer(.1).timeout
hitmarker.visible = false
func toggle_hud(hud_on):
if dead:
crt_filter.visible = hud_on
else:
crosshair.visible = hud_on
ammo_counter.visible = hud_on
stamina_counter.visible = hud_on

View File

@@ -1,8 +1,7 @@
extends Node3D
var recoil_amount : Vector3 = Vector3(.1,0,0)
var snap_amount : float = 10
var speed : float = 4
var speed : float = 10
var current_rotation : Vector3
var target_rotation : Vector3
@@ -17,9 +16,15 @@ func _process(delta: float) -> void:
current_rotation = lerp(current_rotation, target_rotation, snap_amount * delta)
basis = Quaternion.from_euler(current_rotation)
func add_recoil(recoil_amount) -> void:
func add_recoil(recoil_amount,snap_change,speed_change) -> void:
#set to provided snap/speed changes
snap_amount = snap_change
speed = speed_change
#vertical recoil and random L+R recoil within given range
var recoil_x = recoil_amount.x
var recoil_y = randf_range(-recoil_amount.y,recoil_amount.y)
var recoil_z = randf_range(-recoil_amount.z,recoil_amount.z)
#add to target rotation
target_rotation += Vector3(recoil_x, recoil_y, recoil_z)

View File

@@ -11,6 +11,7 @@ var cycle_count
@export_enum("Auto", "Single", "Burst") var fire_mode: int
@export var fov_zoom_amt = .98
@export var recoil_amount : Vector3 = Vector3(1,.1,.1)
@export var recoil_speed_change : float = 4
@export var max_ammo = 15
@export var start_mags = 3
@export var bullet_damage = 1
@@ -153,9 +154,10 @@ func fire(delta):
instance_bullet.random_spread_amt = random_spread_amt
instance_bullet.bullet_force_mod = bullet_force_mod
instance_bullet.player_position = player.global_position
instance_bullet.player_velocity = player.velocity
instance_bullet.instance_bullethole = bullethole.instantiate()
get_tree().get_root().add_child(instance_bullet)
player.recoil.add_recoil(recoil_amount)
player.recoil.add_recoil(recoil_amount,10,recoil_speed_change)
chamber.rotate_object_local(Vector3(0,-1,0),deg_to_rad(60))
func reload(delta):

View File

@@ -14,7 +14,7 @@ var player_position
# Called when the node enters the scene tree for the first time.
func _ready():
linear_velocity += transform.basis * Vector3(0, 0, -bullet_speed) + player_velocity
linear_velocity += transform.basis * Vector3(0, 0, -bullet_speed)
blast_radius = radius_shape.shape.radius
# Called every frame. 'delta' is the elapsed time since the previous frame.
@@ -55,6 +55,7 @@ func explode():
body.linear_velocity += blast_velocity
if body.is_in_group("player"):
body.velocity += clamp(blast_velocity,Vector3(-7,-7,-7),Vector3(7,7,7))
body.recoil.add_recoil(Vector3(1,.1,.1),10,10)
if body.is_in_group("enemy"):
body.knocked = true
body.stunned = true

View File

@@ -100,7 +100,7 @@ func shoot(delta):
instance_bullet.blast_power = blast_power
instance_bullet.player_position = player.global_position
get_tree().get_root().add_child(instance_bullet)
player.recoil.add_recoil(recoil_amount)
player.recoil.add_recoil(recoil_amount,10,10)
if fire_mode != 0:
cycle_count -= 1

View File

@@ -2,3 +2,4 @@ extends Node
signal switch_changed()
signal switch_timeout()
signal enemy_hit()