fixed death cam fov and added damage numbers

This commit is contained in:
derek
2024-08-07 15:57:48 -05:00
parent 795e1ae7f6
commit fb1dd498b4
12 changed files with 258 additions and 46 deletions

13
assets/damage_number.tscn Normal file
View File

@@ -0,0 +1,13 @@
[gd_scene load_steps=3 format=3 uid="uid://41iv1ualpttf"]
[ext_resource type="FontFile" uid="uid://bckxhcc1eudvn" path="res://assets/fonts/Plane Crash.ttf" id="1_e33md"]
[ext_resource type="Script" path="res://scripts/DamageNumber.gd" id="2_5bruy"]
[node name="DamageNumber" type="Label3D" groups=["spawned"]]
billboard = 2
modulate = Color(1, 1, 1, 0)
text = "1
"
font = ExtResource("1_e33md")
font_size = 60
script = ExtResource("2_5bruy")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=3 format=3 uid="uid://by7qyyhyurlw"]
[gd_scene load_steps=6 format=3 uid="uid://by7qyyhyurlw"]
[ext_resource type="Script" path="res://scripts/dead_cam.gd" id="1_qxtd8"]
@@ -8,12 +8,51 @@ dof_blur_near_enabled = true
dof_blur_near_transition = 4.0
dof_blur_amount = 0.2
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_m5ien"]
blend_mode = 1
[sub_resource type="Animation" id="Animation_4scpm"]
resource_name = "whiteout"
length = 0.05
step = 0.01
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Whiteout:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
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)]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.05),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"reload_level"
}]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_jsgjq"]
_data = {
"whiteout": SubResource("Animation_4scpm")
}
[node name="DeadCam" type="Node3D" groups=["spawned"]]
script = ExtResource("1_qxtd8")
[node name="Camera3D" type="Camera3D" parent="."]
attributes = SubResource("CameraAttributesPractical_2gkpp")
fov = 13.6855
fov = 15.0
[node name="LookRay" type="RayCast3D" parent="."]
target_position = Vector3(0, 0, -1)
@@ -22,4 +61,15 @@ target_position = Vector3(0, 0, -1)
wait_time = 0.4
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)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_jsgjq")
}
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

View File

@@ -394,7 +394,7 @@ _data = {
[node name="mac10" node_paths=PackedStringArray("flare_light", "anim_player", "barrel_raycast", "casing_ejector", "mag_ejector", "audio_fire", "audio_empty", "audio_reload") instance=ExtResource("1_nb4p5")]
script = ExtResource("2_6i1l4")
gun_name = "Mac 10"
recoil_amount = 1.5
recoil_amount = 1.1
max_ammo = 30
bullet_damage = 2
bullet_drop = 0.01

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=59 format=3 uid="uid://djr7vnr1hcx82"]
[gd_scene load_steps=60 format=3 uid="uid://djr7vnr1hcx82"]
[ext_resource type="Script" path="res://scripts/spider.gd" id="1_7e7fe"]
[ext_resource type="Texture2D" uid="uid://dmyn4eq2r12ue" path="res://assets/Models/spider1.albedoRAW.png" id="1_di6b8"]
@@ -14,6 +14,7 @@
[ext_resource type="Script" path="res://scripts/EnemyTarget.gd" id="7_8vkma"]
[ext_resource type="PackedScene" uid="uid://brcuqlvgpw4su" path="res://assets/health_pickup.tscn" id="7_i7u4i"]
[ext_resource type="PackedScene" uid="uid://b0rkkp07y3fnu" path="res://assets/die_particles.tscn" id="7_w22oa"]
[ext_resource type="PackedScene" uid="uid://41iv1ualpttf" path="res://assets/damage_number.tscn" id="9_rmegy"]
[ext_resource type="AudioStream" uid="uid://0n251thxlnnp" path="res://assets/Audio/cannon-fire-single-shot-blast-explosion-SBA-300098885.wav" id="10_2qmhc"]
[ext_resource type="Material" uid="uid://46g0pn1jxl2h" path="res://assets/materials/spidermat.tres" id="12_p343g"]
@@ -740,6 +741,7 @@ ammo = ExtResource("5_k1lw4")
money = ExtResource("6_ihv2y")
health_pickup = ExtResource("7_i7u4i")
die_particles = ExtResource("7_w22oa")
damage_number = ExtResource("9_rmegy")
[node name="TurretLook" type="RayCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00161432, 1.62046, 0.00134204)