added breakable vent

This commit is contained in:
derek
2024-12-12 15:08:44 -06:00
parent 7e3ea3602c
commit 763b074148
29 changed files with 1882 additions and 56 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cjv3jvf3xi37j"
path.s3tc="res://.godot/imported/vent1.albedo.png-465560b410b5d0fe111441c332d544db.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/Models/vent1.albedo.png"
dest_files=["res://.godot/imported/vent1.albedo.png-465560b410b5d0fe111441c332d544db.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

BIN
assets/Models/vent1.blend Normal file

Binary file not shown.

View File

@@ -0,0 +1,51 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dcoryoj0xelvd"
path="res://.godot/imported/vent1.blend-3791629a4770f10ba1518958e3885776.scn"
[deps]
source_file="res://assets/Models/vent1.blend"
dest_files=["res://.godot/imported/vent1.blend-3791629a4770f10ba1518958e3885776.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
blender/nodes/visible=0
blender/nodes/active_collection_only=false
blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/colors=false
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/tangents=true
blender/meshes/skins=2
blender/meshes/export_bones_deforming_mesh_only=false
blender/materials/unpack_enabled=true
blender/materials/export_materials=1
blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true

BIN
assets/Models/vent1.blend1 Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bbhu3ab42l3ut"
path.s3tc="res://.godot/imported/vent1.normal.png-ded8a05b894ae88f21e8bc54b0a92b6c.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/Models/vent1.normal.png"
dest_files=["res://.godot/imported/vent1.normal.png-ded8a05b894ae88f21e8bc54b0a92b6c.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=1
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=1
roughness/src_normal="res://assets/Models/vent1.normal.png"
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=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://itnxqm36ul8f"
path.s3tc="res://.godot/imported/vent1.rough.png-dd16513f2e4a8aaec7b2c179b6ec1c54.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/Models/vent1.rough.png"
dest_files=["res://.godot/imported/vent1.rough.png-dd16513f2e4a8aaec7b2c179b6ec1c54.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://da5utu6mhgped"
path="res://.godot/imported/Ladder.png-f4dfcb2b9e8d3a2e01c09f643a59c5b9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Textures/ObjectTextures/Ladder.png"
dest_files=["res://.godot/imported/Ladder.png-f4dfcb2b9e8d3a2e01c09f643a59c5b9.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=111 format=4 uid="uid://6agmt1hqlhww"]
[gd_scene load_steps=112 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"]
@@ -43,6 +43,7 @@
[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"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_eiud5"]
sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
@@ -2031,6 +2032,9 @@ transform = Transform3D(0.169259, 0, 1.49042, 0, 1.5, 0, -1.49042, 0, 0.169259,
[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)
[connection signal="body_entered" from="Room1/RoomCheck" to="Room1/RoomCheck" method="_on_body_entered"]
[connection signal="body_exited" from="Room1/RoomCheck" to="Room1/RoomCheck" method="_on_body_exited"]
[connection signal="body_entered" from="Room3/RoomCheck2" to="Room3/RoomCheck2" method="_on_body_entered"]

View File

@@ -206,7 +206,7 @@ sound = NodePath("Piece 1/BrokenSound")
[node name="Piece 1" type="RigidBody3D" parent="." groups=["scene_rigidbody"]]
collision_layer = 32
collision_mask = 125
collision_mask = 253
[node name="bottle1_broken_cell" type="MeshInstance3D" parent="Piece 1" groups=["scene_rigidbody"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.066139, 0.324223, -0.067418)
@@ -222,7 +222,7 @@ stream = SubResource("AudioStreamRandomizer_f7avk")
[node name="Piece 2" type="RigidBody3D" parent="." groups=["scene_rigidbody"]]
collision_layer = 32
collision_mask = 125
collision_mask = 253
[node name="bottle1_broken_cell_001" type="MeshInstance3D" parent="Piece 2" groups=["scene_rigidbody"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00347066, -0.310987, 0.106893)
@@ -235,7 +235,7 @@ shape = SubResource("ConvexPolygonShape3D_2ytqg")
[node name="Piece 3" type="RigidBody3D" parent="." groups=["scene_rigidbody"]]
collision_layer = 32
collision_mask = 125
collision_mask = 253
[node name="bottle1_broken_cell_002" type="MeshInstance3D" parent="Piece 3" groups=["scene_rigidbody"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0177096, 0.440996, 0.0680487)
@@ -248,7 +248,7 @@ shape = SubResource("ConvexPolygonShape3D_78sq8")
[node name="Piece 4" type="RigidBody3D" parent="." groups=["scene_rigidbody"]]
collision_layer = 32
collision_mask = 125
collision_mask = 253
[node name="bottle1_broken_cell_003" type="MeshInstance3D" parent="Piece 4" groups=["scene_rigidbody"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.000561402, -0.247355, -0.010017)
@@ -261,7 +261,7 @@ shape = SubResource("ConvexPolygonShape3D_xqauf")
[node name="Piece 5" type="RigidBody3D" parent="." groups=["scene_rigidbody"]]
collision_layer = 32
collision_mask = 125
collision_mask = 253
[node name="bottle1_broken_cell_004" type="MeshInstance3D" parent="Piece 5" groups=["scene_rigidbody"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.030646, 0.558282, -0.0404844)

View File

@@ -740,6 +740,33 @@ _surfaces = [{
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_0sgiw")
[sub_resource type="Animation" id="Animation_fujhx"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("revolver1:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0.450033, 0.244207, -1.5708)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("revolver1:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0.0258306, 0, -0.0631607)]
}
[sub_resource type="Animation" id="Animation_8akx8"]
resource_name = "empty"
length = 0.3
@@ -1053,33 +1080,6 @@ tracks/2/keys = {
}]
}
[sub_resource type="Animation" id="Animation_fujhx"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("revolver1:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0.450033, 0.244207, -1.5708)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("revolver1:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0.0258306, 0, -0.0631607)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_2kb78"]
_data = {
"RESET": SubResource("Animation_fujhx"),
@@ -1098,7 +1098,6 @@ gun_name = ".44 Galore"
gun_icon = ExtResource("3_nl201")
fire_mode = 1
fov_zoom_amt = 25
ads = true
recoil_amount = Vector3(0.25, 0.1, 0.1)
max_ammo = 6
bullet_damage = 5
@@ -1137,7 +1136,7 @@ audio_empty = NodePath("Audio/Empty")
audio_reload = NodePath("Audio/Reload")
[node name="revolver1" parent="." index="0"]
transform = Transform3D(-0.0315538, 0.291099, 0.0653137, -0.27013, -9.77867e-07, -0.130499, -0.126626, -0.0725364, 0.262115, 0.0258306, 0, -0.0631607)
transform = Transform3D(-0.0315539, 0.291099, 0.0653139, -0.27013, -9.77868e-07, -0.130499, -0.126626, -0.0725366, 0.262115, 0.0258306, 0, -0.0631607)
mesh = SubResource("ArrayMesh_a1hah")
[node name="Chamber" parent="revolver1" index="0"]
@@ -1203,7 +1202,7 @@ transform = Transform3D(4.17223e-07, 7.04731e-19, 2.10229, -2.98023e-07, -2.1022
mesh = SubResource("ArrayMesh_0w43n")
[node name="Trigger" parent="revolver1" index="2"]
transform = Transform3D(0.207537, -0.978227, 3.54117e-06, 0, -3.61999e-06, -1, 0.978227, 0.207537, -7.51281e-07, 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)
mesh = SubResource("ArrayMesh_ahftj")
[node name="flare" type="MeshInstance3D" parent="revolver1" index="3"]

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=15 format=3 uid="uid://t0w0bolkucwl"]
[gd_scene load_steps=16 format=3 uid="uid://t0w0bolkucwl"]
[ext_resource type="Script" path="res://scripts/texture_catcher.gd" id="1_x3mk2"]
[ext_resource type="PackedScene" uid="uid://2o2wcc5i1al4" path="res://assets/rocket_launcher.tscn" id="2_i6mk3"]
[ext_resource type="PackedScene" uid="uid://brl0bsqjl5dg3" path="res://assets/mac_10.tscn" id="2_u0ggi"]
[ext_resource type="PackedScene" uid="uid://cgo4qyul7ix5p" path="res://assets/ladder.tscn" id="2_yts0x"]
[ext_resource type="PackedScene" uid="uid://cwutm86yp0rk6" path="res://assets/crown.tscn" id="3_gog5n"]
[ext_resource type="PackedScene" uid="uid://b5eclfg0cmmal" path="res://assets/revolver_1.tscn" id="3_yqo0y"]
[ext_resource type="PackedScene" uid="uid://dslxb3psx30vp" path="res://assets/pistol1.tscn" id="5_v3dls"]
@@ -49,11 +50,12 @@ render_target_update_mode = 4
[node name="Camera3D" type="Camera3D" parent="CAPTURE/SubViewport"]
transform = Transform3D(-0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, -0.707107, -0.697249, -2.38419e-07, -0.649448)
size = 1.86
[node name="snapshotModel" type="Node3D" parent="CAPTURE/SubViewport"]
[node name="RocketLauncher" parent="CAPTURE/SubViewport/snapshotModel" instance=ExtResource("2_i6mk3")]
transform = Transform3D(0.992614, 0, 0.121315, 0, 1, 0, -0.121315, 0, 0.992614, 0.457345, -0.229299, 0.266961)
transform = Transform3D(0.993044, 0, 0.117746, 0, 1, 0, -0.117746, 0, 0.993044, 0.404976, -0.229299, 0.321818)
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = SubResource("ViewportTexture_xiqw1")
@@ -62,6 +64,9 @@ texture = SubResource("ViewportTexture_xiqw1")
transform = Transform3D(-0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, -0.707107, -0.697249, -2.38419e-07, -0.649448)
visible = false
[node name="Pistol" parent="PHOTOGRAPHED" instance=ExtResource("5_v3dls")]
transform = Transform3D(-0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, -0.707107, 0.139735, -0.0145502, -1.10556)
[node name="Crown" parent="PHOTOGRAPHED" instance=ExtResource("3_gog5n")]
transform = Transform3D(-0.896591, 0.345323, -0.277267, 0.104303, 0.773128, 0.625615, 0.430402, 0.532001, -0.729197, -0.297585, -0.374549, -1.68743)
@@ -74,14 +79,14 @@ transform = Transform3D(-0.292272, 0, 0.956335, 0, 1, 0, -0.956335, 0, -0.292272
[node name="Tree2" parent="PHOTOGRAPHED" instance=ExtResource("10_g2f5o")]
transform = Transform3D(0.576019, 0, -0.817437, 0, 1, 0, 0.817437, 0, 0.576019, -1.21889, -5.23911, -11.0324)
[node name="Ladder" parent="PHOTOGRAPHED" instance=ExtResource("2_yts0x")]
transform = Transform3D(-0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, -0.707107, 0.0283049, -1.64915, -3.75383)
[node name="mac10" parent="PHOTOGRAPHED" instance=ExtResource("2_u0ggi")]
transform = Transform3D(-0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, -0.707107, -0.0338004, 0.0101067, -0.952258)
transform = Transform3D(-0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, -0.707107, -0.0338004, 0.189329, -0.952258)
[node name="revolver1" parent="PHOTOGRAPHED" instance=ExtResource("3_yqo0y")]
transform = Transform3D(-0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, -0.707107, 0.116568, 0.0718296, -1.10969)
[node name="Pistol" parent="PHOTOGRAPHED" instance=ExtResource("5_v3dls")]
transform = Transform3D(-0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, -0.707107, 0.139735, -0.0145502, -1.10556)
transform = Transform3D(-0.707107, -0.278797, 0.649825, 0, 0.918991, 0.394279, -0.707107, 0.278797, -0.649825, 0.116568, 0.0718296, -1.10969)
[node name="Blunderbus" parent="PHOTOGRAPHED" instance=ExtResource("7_do5lr")]
transform = Transform3D(-0.671708, 0, 0.740816, 0, 1, 0, -0.740816, 0, -0.671708, 0.160119, 2.38419e-07, -1.5088)
transform = Transform3D(-0.74921, 0, 0.662332, 0, 1, 0, -0.662332, 0, -0.74921, 0.125256, 2.38419e-07, -1.6817)

152
assets/vent_1.tscn Normal file

File diff suppressed because one or more lines are too long

1364
assets/vent_1_broken.tscn Normal file

File diff suppressed because one or more lines are too long

View File

@@ -11,7 +11,7 @@ config_version=5
[application]
config/name="First Person Test"
run/main_scene="res://assets/blockout_2.tscn"
run/main_scene="res://scenes/asset_checker.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
config/icon="res://icon.svg"
@@ -22,6 +22,7 @@ SignalBus="*res://scripts/signal_bus.gd"
SwitchBasic="*res://scripts/switch_basic.gd"
RigidbodyGeneric="*res://scripts/rigidbody_generic.gd"
GameGlobals="*res://scripts/game_globals.gd"
HelperFuncs="*res://scripts/HelperFuncs.gd"
[display]
@@ -53,6 +54,7 @@ moveable=""
door=""
spawned=""
persist=""
breakable=""
[input]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=52 format=4 uid="uid://f7e0v1r6ra6c"]
[gd_scene load_steps=54 format=4 uid="uid://f7e0v1r6ra6c"]
[ext_resource type="Script" path="res://scripts/LevelManager.gd" id="1_saj4q"]
[ext_resource type="PackedScene" uid="uid://b5eclfg0cmmal" path="res://assets/revolver_1.tscn" id="2_ntm2q"]
@@ -31,6 +31,8 @@
[ext_resource type="PackedScene" uid="uid://cucqbjb8bcha5" path="res://assets/blunderbuss_pickup.tscn" id="29_kr1fy"]
[ext_resource type="PackedScene" uid="uid://clu76sc4uoswn" path="res://assets/rocketlauncher_pickup.tscn" id="30_msqcq"]
[ext_resource type="PackedScene" uid="uid://dlhjacsike5a4" path="res://assets/oildrum1.tscn" id="31_jbe2q"]
[ext_resource type="PackedScene" uid="uid://df34olntmk0wl" path="res://assets/vent_1.tscn" id="32_x8mvi"]
[ext_resource type="PackedScene" uid="uid://dt4t2a48204v1" path="res://assets/spikes_1.tscn" id="33_u3uct"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_py8au"]
@@ -309,8 +311,8 @@ shadow_mesh = SubResource("ArrayMesh_7g1e1")
[node name="AssetChecker" type="Node3D" node_paths=PackedStringArray("player")]
script = ExtResource("1_saj4q")
load_save = false
player = NodePath("Player")
start_health = 10
gun_1 = ExtResource("2_ntm2q")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
@@ -336,12 +338,28 @@ collision_mask = 257
size = Vector3(30.1939, 1.6937, 36.37)
[node name="CSGBox3D6" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.07212, 1.87281, 18.7684)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.1144, 1.87281, 18.7684)
material_override = ExtResource("3_pecld")
use_collision = true
collision_layer = 257
collision_mask = 257
size = Vector3(30.1939, 0.315722, 13.2553)
size = Vector3(30.2785, 0.315722, 13.2553)
[node name="CSGBox3D7" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.1111, 0.893751, 24.2787)
material_override = ExtResource("3_pecld")
use_collision = true
collision_layer = 257
collision_mask = 257
size = Vector3(30.2719, 2.01716, 2.23472)
[node name="CSGBox3D8" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.10042, 0.893751, 20.3234)
material_override = ExtResource("3_pecld")
use_collision = true
collision_layer = 257
collision_mask = 257
size = Vector3(30.2505, 2.01716, 2.64598)
[node name="CSGBox3D2" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -18.808, 1.35714, 0)
@@ -539,3 +557,15 @@ transform = Transform3D(-0.136113, 0, 0.990693, 0, 1, 0, -0.990693, 0, -0.136113
[node name="RigidBody3D" parent="." instance=ExtResource("31_jbe2q")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.3714, 1.04444, -2.16718)
[node name="Spikes 1" parent="." instance=ExtResource("33_u3uct")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.84169, 0.107734, 17.6221)
[node name="Spikes 2" parent="." instance=ExtResource("33_u3uct")]
transform = Transform3D(1, 0, 0, 0, 0.0235074, 0.999724, 0, -0.999724, 0.0235074, -11.8004, 1.17955, 17.6221)
[node name="Spikes 3" parent="." instance=ExtResource("33_u3uct")]
transform = Transform3D(1, 0, 0, 0, -0.998757, 0.0498434, 0, -0.0498434, -0.998757, -15.9858, 4.45433, 17.4349)
[node name="Vent1" parent="." instance=ExtResource("32_x8mvi")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 23.1191, 0.923517, 22.4057)

22
scripts/HelperFuncs.gd Normal file
View File

@@ -0,0 +1,22 @@
extends Node
## ANGLES
# Check if a colliding body is aligned within a given angle of the object
# max_angle_diff --- note: set to 1 if angle won't be counted
# currently only works when objects are scaled (1,1,1)
func angle_velocity_aligned(source:Node,source_angle:Vector3,body:Node,max_angle_diff:Vector3):
var obj_direction = source.basis * source_angle
print("SOURCE BASIS ",source.basis)
var player_direction = body.velocity.normalized()
var diff = abs(abs(obj_direction) - abs(player_direction))
print("------------------------------------------------------------")
print("OBJ DIRECTION: ",obj_direction)
print("PLAYER DIRECTION: ", player_direction)
print("MAX ANGLE DIFF ",max_angle_diff)
print("DIFFERENCE: ", diff)
print("------------------------------------------------------------")
if diff.x <= max_angle_diff.x and diff.y <= max_angle_diff.y and diff.z <= max_angle_diff.z:
return true
else:
return false

View File

@@ -383,7 +383,7 @@ func _physics_process(delta):
else:
moveable_holder.rotation.y -= deg_to_rad(45)
for i in range(10):
for i in range(1,9):
if Input.is_action_just_pressed("numb_" + str(i)):
if gun != null:
if !gun.anim_player.is_playing():

View File

@@ -6,7 +6,6 @@ extends Node3D
@export var taunts : Array[String] = []
@onready var outline_meshes = [$Spikes1/MeshInstance3D]
@onready var ray_cast: RayCast3D = $RayCast3D
# Called when the node enters the scene tree for the first time.
@@ -20,5 +19,7 @@ func _process(delta: float) -> void:
func _on_area_3d_body_entered(body: Node3D) -> void:
if body.is_in_group("player"):
body.hit(damage,self,enemy_type)
body.velocity = ray_cast.global_transform.basis * Vector3(0,0,-pushback)
if HelperFuncs.angle_velocity_aligned(self,Vector3(0,-1,0),body,Vector3(.7,.7,.7)):
body.hit(damage,self,enemy_type)
var bounce_velocity = -body.velocity
body.velocity = bounce_velocity

56
scripts/vent_1.gd Normal file
View File

@@ -0,0 +1,56 @@
extends Node3D
@export var broken_object : Resource
@export var break_velocity : float = 10
var can_break : bool = true
var break_on_land : bool = false
var held_currently : bool = false
@onready var collision_shape_3d: CollisionShape3D = $CollisionShape3D
@onready var breaking_sound: AudioStreamPlayer3D = $BreakingSound
# Called when the node enters the scene tree for the first time.
func _ready():
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func breaking(current_velocity):
breaking_sound.play()
var spawn_broken = broken_object.instantiate()
spawn_broken.position = global_position
spawn_broken.transform.basis = global_transform.basis
spawn_broken.rotation = rotation
var pieces = spawn_broken.get_children()
for piece in pieces:
if piece is RigidBody3D:
piece.linear_velocity += current_velocity
get_tree().get_root().add_child(spawn_broken)
visible = false
await get_tree().create_timer(.5).timeout
queue_free()
func _on_area_3d_body_entered(body: Node3D) -> void:
if can_break:
if body.is_in_group("player") and body.crouched and body.velocity.length() > 5:
if HelperFuncs.angle_velocity_aligned(self,Vector3(0,0,1),body,Vector3(.2,1,.2)):
collision_shape_3d.disabled = true
can_break = false
breaking(body.velocity)
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,
}
return save_dict