added punch animation and can now melee enemies

This commit is contained in:
Derek
2025-01-19 18:20:31 -06:00
parent 5978a90017
commit 4638c97b84
6 changed files with 91 additions and 45 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=112 format=4 uid="uid://6agmt1hqlhww"]
[gd_scene load_steps=108 format=4 uid="uid://6agmt1hqlhww"]
[ext_resource type="Script" path="res://scripts/LevelManager.gd" id="1_sbpvn"]
[ext_resource type="PackedScene" uid="uid://brl0bsqjl5dg3" path="res://assets/mac_10.tscn" id="2_fn4vb"]
@@ -37,11 +37,7 @@
[ext_resource type="Script" path="res://scripts/switch_interactandshoot.gd" id="35_ybetb"]
[ext_resource type="Script" path="res://levels/switch_target.gd" id="36_fuepo"]
[ext_resource type="PackedScene" uid="uid://cucqbjb8bcha5" path="res://assets/blunderbuss_pickup.tscn" id="38_1e38i"]
[ext_resource type="PackedScene" uid="uid://bww5k3t3yu7m0" path="res://assets/mug.tscn" id="40_il4b1"]
[ext_resource type="PackedScene" uid="uid://co12h258tg1ud" path="res://assets/wet_floor_sign.tscn" id="41_h2hhd"]
[ext_resource type="PackedScene" uid="uid://ciw10g8q4td1y" path="res://assets/tv.tscn" id="42_5scug"]
[ext_resource type="PackedScene" uid="uid://bcmd7elfjhppe" path="res://assets/tree_1.tscn" id="43_o23bq"]
[ext_resource type="PackedScene" uid="uid://df34olntmk0wl" path="res://assets/vent_1.tscn" id="44_b0rr7"]
[ext_resource type="PackedScene" uid="uid://dlhjacsike5a4" path="res://assets/oildrum1.tscn" id="45_eatji"]
[ext_resource type="PackedScene" uid="uid://bj1y0fbjtul4a" path="res://post_processing.tscn" id="45_lveut"]
@@ -1062,6 +1058,7 @@ transform = Transform3D(0.0198257, 0, 0.999803, 0, 1, 0, -0.999803, 0, 0.0198257
[node name="Room1" type="Node" parent="."]
script = ExtResource("13_84vop")
room_lockdown = true
key_drop = true
[node name="spider" parent="Room1" instance=ExtResource("8_h7fp0")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.13669, -0.399995, 1.3536)
@@ -2009,25 +2006,13 @@ autoplay = "HallSpikes"
[node name="blunderbuss_pickup" parent="." instance=ExtResource("38_1e38i")]
transform = Transform3D(0.680363, 0, 0.732875, 0, 1, 0, -0.732875, 0, 0.680363, -2.95896, 1.92659, 16.5021)
[node name="Mug" parent="." instance=ExtResource("40_il4b1")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.82237, 1.87648, 13.6332)
[node name="WetFloorSign" parent="." instance=ExtResource("41_h2hhd")]
transform = Transform3D(-0.514973, 0, 1.40883, 0, 1.5, 0, -1.40883, 0, -0.514973, -2.71954, 0.612816, 12.0582)
[node name="OmniLight3D" type="OmniLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.38495, 2.76978, 14.3463)
shadow_enabled = true
[node name="TV" parent="." instance=ExtResource("42_5scug")]
transform = Transform3D(0.169259, 0, 1.49042, 0, 1.5, 0, -1.49042, 0, 0.169259, -2.75525, 1.73891, 12.7455)
[node name="Tree1" parent="." instance=ExtResource("43_o23bq")]
transform = Transform3D(4.135, 0, 0, 0, 4.135, 0, 0, 0, 4.135, 26.563, 13.3468, 261.018)
[node name="Vent1" parent="." instance=ExtResource("44_b0rr7")]
transform = Transform3D(0.462863, 0, 0.88643, 0, 1, 0, -0.88643, 0, 0.462863, -1.87132, 0.546506, 10.544)
[node name="Oildrum1" parent="." instance=ExtResource("45_eatji")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.46674, 27.457, -7.49986)

View File

@@ -702,7 +702,7 @@ audio_empty = NodePath("Audio/Empty")
audio_reload = NodePath("Audio/Reload")
[node name="mac10" parent="." index="0"]
transform = Transform3D(-1.08301e-06, -8.05094e-08, -0.3, -0.0225093, 0.299154, 9.76756e-10, 0.299154, 0.0225093, -1.086e-06, -0.00876398, 0.0748287, -0.0557729)
transform = Transform3D(-1.08301e-06, -8.05088e-08, -0.3, -0.0225093, 0.299154, 9.77362e-10, 0.299154, 0.0225093, -1.086e-06, -0.00876398, 0.0748287, -0.0557729)
cast_shadow = 0
lod_bias = 10.0
mesh = SubResource("ArrayMesh_pcg38")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=35 format=3 uid="uid://drwae3loscbw7"]
[gd_scene load_steps=38 format=3 uid="uid://drwae3loscbw7"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_x7wms"]
[ext_resource type="Script" path="res://scripts/recoil.gd" id="3_405jc"]
@@ -36,8 +36,6 @@ radius = 0.509802
height = 1.19106
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_vhypf"]
dof_blur_far_enabled = true
dof_blur_near_enabled = true
dof_blur_amount = 0.3
[sub_resource type="FastNoiseLite" id="FastNoiseLite_vupcx"]
@@ -80,6 +78,55 @@ random_pitch = 2.0
streams_count = 1
stream_0/stream = ExtResource("19_pi7h7")
[sub_resource type="Animation" id="Animation_llq31"]
resource_name = "punch"
length = 0.75
step = 0.01
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.3),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"punch"
}]
}
tracks/1/type = "position_3d"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Head/Recoil/Camera3D/WeaponHolder")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = PackedFloat32Array(0, 1, 0, -0.0341401, -0.111267, 0.19, 1, 0.0274239, -0.455616, 0.416463, 0.23, 1, 0.0346386, -0.441928, 0.312534, 0.3, 1, 0.129892, -0.454487, -0.652062, 0.37, 1, 0.091674, -0.439886, -0.496679, 0.75, 1, 0, -0.0341401, -0.111267)
tracks/2/type = "rotation_3d"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Head/Recoil/Camera3D/WeaponHolder")
tracks/2/interp = 2
tracks/2/loop_wrap = true
tracks/2/keys = PackedFloat32Array(0, 1, 0, 0, 0, 1, 0.19, 1, 0.429604, -0.0899337, -0.184524, 0.879377, 0.23, 1, 0.404158, -0.0814679, -0.189232, 0.891186, 0.3, 1, 0.0843464, 0.014675, -0.188657, 0.978305, 0.37, 1, 0.124325, 0.0221516, -0.181308, 0.975285, 0.75, 1, 0, 0, 0, 1)
[sub_resource type="Animation" id="Animation_q5egb"]
length = 0.001
tracks/0/type = "position_3d"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Head/Recoil/Camera3D/WeaponHolder")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = PackedFloat32Array(0, 1, 0, -0.0341401, -0.111267)
[sub_resource type="AnimationLibrary" id="AnimationLibrary_d0x8a"]
_data = {
"RESET": SubResource("Animation_q5egb"),
"punch": SubResource("Animation_llq31")
}
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("weapon_holder") groups=["persist", "player"]]
transform = Transform3D(1, 0.000164476, 0.000583754, -0.000165075, 0.999999, 0.00104027, -0.000583585, -0.00104036, 0.999999, 0, 1.11359, 0)
collision_layer = 6
@@ -180,7 +227,7 @@ script = ExtResource("10_ektr6")
[node name="InteractRay" type="RayCast3D" parent="Head/Recoil/Camera3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.00322104, -0.0232438)
target_position = Vector3(0, 0, -2.5)
collision_mask = 34
collision_mask = 162
hit_back_faces = false
collide_with_areas = true
@@ -261,6 +308,11 @@ stream = SubResource("AudioStreamRandomizer_u5cxn")
[node name="Crouch" type="AudioStreamPlayer3D" parent="Audio"]
stream = SubResource("AudioStreamRandomizer_xswn0")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_d0x8a")
}
[connection signal="tree_entered" from="." to="." method="_on_tree_entered"]
[connection signal="body_entered" from="pick_up_detection" to="." method="_on_pick_up_detection_body_entered"]
[connection signal="body_entered" from="pick_up_magnet" to="." method="_on_pick_up_magnet_body_entered"]