diff --git a/assets/blockout_2.tscn b/assets/blockout_2.tscn index 421b53a..01372d1 100644 --- a/assets/blockout_2.tscn +++ b/assets/blockout_2.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=98 format=4 uid="uid://6agmt1hqlhww"] +[gd_scene load_steps=104 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"] @@ -55,7 +55,6 @@ ssr_enabled = true ssao_enabled = true ssil_enabled = true sdfgi_enabled = true -sdfgi_use_occlusion = true glow_enabled = true glow_bloom = 0.75 fog_enabled = true @@ -378,6 +377,64 @@ _data = { [sub_resource type="BoxShape3D" id="BoxShape3D_e83yk"] size = Vector3(15.8438, 7.78613, 16.0007) +[sub_resource type="BoxMesh" id="BoxMesh_260ws"] +size = Vector3(4.28, 3.97, 0.49) + +[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_g1eis"] +data = PackedVector3Array(-2.14, 1.985, 0.245, 2.14, 1.985, 0.245, -2.14, -1.985, 0.245, 2.14, 1.985, 0.245, 2.14, -1.985, 0.245, -2.14, -1.985, 0.245, 2.14, 1.985, -0.245, -2.14, 1.985, -0.245, 2.14, -1.985, -0.245, -2.14, 1.985, -0.245, -2.14, -1.985, -0.245, 2.14, -1.985, -0.245, 2.14, 1.985, 0.245, 2.14, 1.985, -0.245, 2.14, -1.985, 0.245, 2.14, 1.985, -0.245, 2.14, -1.985, -0.245, 2.14, -1.985, 0.245, -2.14, 1.985, -0.245, -2.14, 1.985, 0.245, -2.14, -1.985, -0.245, -2.14, 1.985, 0.245, -2.14, -1.985, 0.245, -2.14, -1.985, -0.245, 2.14, 1.985, 0.245, -2.14, 1.985, 0.245, 2.14, 1.985, -0.245, -2.14, 1.985, 0.245, -2.14, 1.985, -0.245, 2.14, 1.985, -0.245, -2.14, -1.985, 0.245, 2.14, -1.985, 0.245, -2.14, -1.985, -0.245, 2.14, -1.985, 0.245, 2.14, -1.985, -0.245, -2.14, -1.985, -0.245) + +[sub_resource type="Animation" id="Animation_a3htr"] +resource_name = "open" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:position") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector3(0, 1.94405, 4.78278), Vector3(0, 5.43481, 4.78278)] +} + +[sub_resource type="Animation" id="Animation_jbusa"] +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(0, 1.94405, 4.78278)] +} + +[sub_resource type="Animation" id="Animation_4xq8a"] +resource_name = "close" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:position") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector3(0, 5.43481, 4.78278), Vector3(0, 1.94405, 4.78278)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_hkwf6"] +_data = { +"RESET": SubResource("Animation_jbusa"), +"close": SubResource("Animation_4xq8a"), +"open": SubResource("Animation_a3htr") +} + [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_h6y7f"] resource_name = "dickbutt" transparency = 4 @@ -1043,6 +1100,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -27.1833, -5.75175, 34.3513) [node name="Room1" type="Node" parent="."] script = ExtResource("13_84vop") +room_lockdown = 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) @@ -1055,6 +1113,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8.64712, -4.97979) mesh = SubResource("BoxMesh_y2xby") script = ExtResource("33_1m5er") anim_player = NodePath("AnimationPlayer") +door_open_start = true [node name="StaticBody3D" type="StaticBody3D" parent="Room1/Door"] @@ -1075,6 +1134,23 @@ script = ExtResource("16_ba8wj") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0078125, 3.61475, -4.86536) shape = SubResource("BoxShape3D_e83yk") +[node name="Door2" type="MeshInstance3D" parent="Room1" node_paths=PackedStringArray("anim_player")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.94405, 4.78278) +mesh = SubResource("BoxMesh_260ws") +script = ExtResource("33_1m5er") +anim_player = NodePath("AnimationPlayer") +door_open_start = true + +[node name="StaticBody3D" type="StaticBody3D" parent="Room1/Door2"] + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Room1/Door2/StaticBody3D"] +shape = SubResource("ConcavePolygonShape3D_g1eis") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Room1/Door2"] +libraries = { +"": SubResource("AnimationLibrary_hkwf6") +} + [node name="EnemyHivemind" parent="." instance=ExtResource("7_nut1a")] [node name="spider3" parent="EnemyHivemind" instance=ExtResource("8_h7fp0")] diff --git a/assets/bullet.tscn b/assets/bullet.tscn index 25a569c..cfff405 100644 --- a/assets/bullet.tscn +++ b/assets/bullet.tscn @@ -85,7 +85,7 @@ radius = 0.055 [node name="Bullet" type="RigidBody3D"] top_level = true collision_layer = 0 -collision_mask = 0 +collision_mask = 105 axis_lock_angular_x = true axis_lock_angular_y = true axis_lock_angular_z = true diff --git a/assets/mac_10.tscn b/assets/mac_10.tscn index 9f29ceb..cb9b63a 100644 --- a/assets/mac_10.tscn +++ b/assets/mac_10.tscn @@ -302,7 +302,7 @@ tracks/4/keys = { "times": PackedFloat32Array(0, 0.03, 0.1), "transitions": PackedFloat32Array(1, 1, 1), "update": 0, -"values": [0.0, 10.0, 0.0] +"values": [0.0, 2.0, 0.0] } tracks/5/type = "value" tracks/5/imported = false diff --git a/scripts/bullet.gd b/scripts/bullet.gd index c867c06..c3de936 100644 --- a/scripts/bullet.gd +++ b/scripts/bullet.gd @@ -65,3 +65,9 @@ func _physics_process(delta): ray.get_collider().breaking(current_velocity) queue_free() + + +func _on_body_entered(body: Node) -> void: + if !body.is_in_group("player"): + await get_tree().create_timer(.1).timeout + mesh.visible = false diff --git a/scripts/room_check.gd b/scripts/room_check.gd index 3e1550d..3d9bd90 100644 --- a/scripts/room_check.gd +++ b/scripts/room_check.gd @@ -1,7 +1,7 @@ extends Node -signal player_entered_room() -signal player_left_room() +signal room_entered() +signal room_exited() # Called when the node enters the scene tree for the first time. func _ready() -> void: @@ -13,8 +13,8 @@ func _process(delta: float) -> void: func _on_body_entered(body: Node3D) -> void: if body.is_in_group("player"): - emit_signal("player_entered_room") + emit_signal("room_entered") func _on_body_exited(body: Node3D) -> void: if body.is_in_group("player"): - emit_signal("player_left_room") + emit_signal("room_exited") diff --git a/scripts/room_manager.gd b/scripts/room_manager.gd index 4eee572..4a3aac9 100644 --- a/scripts/room_manager.gd +++ b/scripts/room_manager.gd @@ -1,5 +1,7 @@ extends Node +@export var room_lockdown : bool = false + var enemies = [] var doors = [] var room_checks = [] @@ -16,7 +18,10 @@ func _ready(): doors.append(i) if i.is_in_group("room_check"): room_checks.append(i) + i.room_entered.connect(room_entered) + i.room_exited.connect(room_exited) + print("Doors: " + str(doors)) # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): @@ -53,5 +58,18 @@ func _process(delta): i.last_enemy = true func last_enemy_dead(): + if room_lockdown: + room_lockdown = false + for i in doors: - i.open() + if !i.door_open: + i.open() + +func room_entered(): + if room_lockdown: + for i in doors: + if i.door_open: + i.close() + +func room_exited(): + print("ELVIS HAS LEFT THE BUILDING")