Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit ee8e13b925b62e5658ee7718142a9717e7d28bf0
Author: Aaron Franke <[email protected]>
Date:   Thu Oct 3 14:21:28 2024 -0700

    Fix GDScript style

commit 27a75ce42c018cef4d499da587f6d0416981ad0b
Author: Aaron Franke <[email protected]>
Date:   Tue Sep 17 10:35:58 2024 -0500

    Update for Godot 4.3 and fix robot walk sound (godotengine#188)

commit 08c7ea8
Author: Emre <[email protected]>
Date:   Thu Sep 12 19:55:13 2024 +0300

    basic fix

commit 31c36be
Author: Emre <[email protected]>
Date:   Wed Sep 4 00:03:16 2024 +0300

    Added opening and closing feature to doors

    Added opening and closing feature to doors. When the character comes to the door, it opens automatically. Also, the desired doors are locked and cannot be opened.

commit 8395037
Author: Emre <[email protected]>
Date:   Thu Aug 29 15:16:28 2024 +0300

    Added functional doors to the game map with animations and collisions

    Integrated fully functional doors into the game map, utilizing existing animations and collision objects. This update ensures that all doors within the game are now interactive and operate correctly, providing a more immersive experience. Each door has been configured to open and close as intended when interacted with by the player.
  • Loading branch information
emrecrpnl committed Oct 8, 2024
1 parent b48d4dd commit fd6c140
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 38 deletions.
45 changes: 42 additions & 3 deletions door/door.gd
Original file line number Diff line number Diff line change
@@ -1,10 +1,49 @@
extends Area3D

var open = false

@onready var animation_player = $DoorModel/AnimationPlayer
@export var open: bool = false
@export var is_locked: bool = false

@onready var animation_player: AnimationPlayer= $DoorModel2/AnimationPlayer

@onready var _door_skeleton: Skeleton3D = $"DoorModel2/armature-doorsimple/Skeleton3D"
@onready var left_collision: CollisionShape3D = _door_skeleton.get_node(^"doorleft/CollisionShape3D")
@onready var right_collision: CollisionShape3D = _door_skeleton.get_node(^"doorright/CollisionShape3D")
@onready var upper_collision: CollisionShape3D = _door_skeleton.get_node(^"doorupper/CollisionShape3D")
@onready var lower_collision: CollisionShape3D = _door_skeleton.get_node(^"doorlower/CollisionShape3D")
@onready var lock_indicator_mesh: MeshInstance3D = _door_skeleton.get_node(^"doorsimple")

var override_material := StandardMaterial3D.new()


func _ready():
lock_indicator_mesh.set_surface_override_material(1, override_material)
if is_locked:
override_material.albedo_color = Color.RED
elif not is_locked:
override_material.albedo_color = Color.GREEN


func _process(_delta):
if float(animation_player.current_animation_position) < 1.9:
left_collision.disabled = false
right_collision.disabled = false
upper_collision.disabled = false
lower_collision.disabled = false
else:
left_collision.disabled = true
right_collision.disabled = true
upper_collision.disabled = true
lower_collision.disabled = true


func _on_door_body_entered(body):
if not open and body is Player:
if not open and body is Player and not is_locked:
animation_player.play("doorsimple_opening")
open = true


func _on_body_exited(body):
if open and body is Player and not is_locked:
animation_player.play_backwards("doorsimple_opening")
open = false
27 changes: 23 additions & 4 deletions door/door.tscn
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
[gd_scene load_steps=5 format=3 uid="uid://bcnpdinrepean"]
[gd_scene load_steps=6 format=3 uid="uid://bcnpdinrepean"]

[ext_resource type="Script" path="res://door/door.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://bivo3ncbyf02f" path="res://door/model/door.dae" id="2"]
[ext_resource type="AudioStream" uid="uid://c2nls7s14emyc" path="res://door/open_close.wav" id="3"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8scjh"]
albedo_color = Color(0, 1, 0, 1)

[sub_resource type="BoxShape3D" id="1"]
size = Vector3(8.85286, 6.2089, 11.0664)
size = Vector3(8.85286, 2.26084, 11.0664)

[node name="Door" type="Area3D"]
collision_mask = 5
script = ExtResource("1")

[node name="DoorModel2" parent="." instance=ExtResource("2")]
Expand All @@ -16,21 +20,36 @@ script = ExtResource("1")
bones/1/position = Vector3(2.12019, -3.55271e-15, -1.02721)
bones/2/position = Vector3(-2.12019, -3.55271e-15, -1.02721)

[node name="doorright" parent="DoorModel2/armature-doorsimple/Skeleton3D" index="3"]
disable_mode = 2

[node name="doorsimple" parent="DoorModel2/armature-doorsimple/Skeleton3D" index="4"]
skeleton = NodePath("..")
surface_material_override/1 = SubResource("StandardMaterial3D_8scjh")

[node name="doorupper" parent="DoorModel2/armature-doorsimple/Skeleton3D" index="5"]
disable_mode = 2

[node name="AnimationPlayer" parent="DoorModel2" index="1"]
autoplay = "doorsimple_closed"

[node name="StaticBody3D" type="StaticBody3D" parent="DoorModel2"]

[node name="CollisionPolygon3D" type="CollisionPolygon3D" parent="DoorModel2/StaticBody3D"]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0)
depth = 7.0
polygon = PackedVector2Array(-0.738063, 0.291718, 0.738, 0.292, 1.8, -0.6, -1.8, -0.6)

[node name="sound" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource("3")
volume_db = 4.0
volume_db = 11.597
unit_size = 7.0

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.55109, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.77966, 0)
shape = SubResource("1")

[connection signal="body_entered" from="." to="." method="_on_door_body_entered"]
[connection signal="body_exited" from="." to="." method="_on_body_exited"]

[editable path="DoorModel2"]
2 changes: 1 addition & 1 deletion door/model/door_unlockedemission.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://bdwoat2ni1pgo"]
[gd_resource type="StandardMaterial3D" format=3 uid="uid://cs802djrjvrop"]

[resource]
resource_name = "door_unlockedemission"
Expand Down
4 changes: 1 addition & 3 deletions enemies/red_robot/laser/smoke.tres
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[gd_resource type="ShaderMaterial" load_steps=5 format=3 uid="uid://bhf6kwdlc7f5h"]
[gd_resource type="ShaderMaterial" load_steps=4 format=3 uid="uid://bhf6kwdlc7f5h"]

[ext_resource type="Shader" path="res://enemies/red_robot/laser/smoke.gdshader" id="1_j0r3f"]
[ext_resource type="Texture2D" uid="uid://i5ll5xqsm55y" path="res://enemies/red_robot/laser/BarrelSmokeTexture.png" id="2"]

[sub_resource type="FastNoiseLite" id="29"]

Expand All @@ -14,5 +13,4 @@ noise = SubResource("29")
[resource]
render_priority = 0
shader = ExtResource("1_j0r3f")
shader_parameter/smoke_texture = ExtResource("2")
shader_parameter/noise_texture = SubResource("30")
2 changes: 1 addition & 1 deletion level/geometry/models/light_shafts.tres
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ void fragment() {
[resource]
render_priority = 0
shader = SubResource("1")
shader_parameter/tex = ExtResource("1")
shader_parameter/color = Color(1, 1, 1, 0.223529)
shader_parameter/max_dist = 2.0
shader_parameter/min_dist = 5.0
shader_parameter/curve = 5.87
shader_parameter/dp_curve = 0.56
shader_parameter/tex = ExtResource("1")
12 changes: 0 additions & 12 deletions level/geometry/scenes/collision/radial_colliders.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -341,30 +341,18 @@ shape = SubResource("30")
[node name="WallPillar7" type="CollisionShape3D" parent="."]
transform = Transform3D(0.649877, -0.455049, -0.608761, 0.573577, 0.819152, 0, 0.498668, -0.349171, 0.793353, 24.1973, 11.5, 18.5672)
shape = SubResource("30")
__meta__ = {
"_editor_description_": ""
}

[node name="WallPillar8" type="CollisionShape3D" parent="."]
transform = Transform3D(0.77906, -0.545503, 0.309017, 0.573577, 0.819152, 0, -0.253132, 0.177245, 0.951056, 29.0072, 11.5, -9.42502)
shape = SubResource("30")
__meta__ = {
"_editor_description_": ""
}

[node name="WallPillar9" type="CollisionShape3D" parent="."]
transform = Transform3D(0.649877, -0.455049, 0.608761, 0.573577, 0.819152, 0, -0.498668, 0.349171, 0.793353, 24.1973, 11.5, -18.5672)
shape = SubResource("30")
__meta__ = {
"_editor_description_": ""
}

[node name="WallPillar10" type="CollisionShape3D" parent="."]
transform = Transform3D(0.409576, -0.286788, 0.866025, 0.573577, 0.819152, 0, -0.709406, 0.496732, 0.5, 15.25, 11.5, -26.4138)
shape = SubResource("30")
__meta__ = {
"_editor_description_": ""
}

[node name="Wall1" type="CollisionShape3D" parent="."]
transform = Transform3D(0.884988, 0, -0.465615, 0, 1, 0, 0.465615, 0, 0.884988, 34.5588, 0, 18.1822)
Expand Down
3 changes: 0 additions & 3 deletions level/geometry/scenes/collision/radial_player_only.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,3 @@ shape = SubResource("2")
[node name="ArmBasePlayerOnly" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.9, -12.4, 0)
shape = SubResource("3")
__meta__ = {
"_editor_description_": ""
}
9 changes: 8 additions & 1 deletion level/geometry/scenes/core.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=37 format=3 uid="uid://ddbnmy6um5fjg"]
[gd_scene load_steps=38 format=3 uid="uid://ddbnmy6um5fjg"]

[ext_resource type="PackedScene" uid="uid://ckpf3t16u47pu" path="res://level/geometry/scenes/collision/radial_colliders.tscn" id="1"]
[ext_resource type="PackedScene" uid="uid://bcnpdinrepean" path="res://door/door.tscn" id="1_d4yh0"]
[ext_resource type="PackedScene" uid="uid://babdc0gjbduw" path="res://level/geometry/scenes/collision/stair_pillar.tscn" id="2"]
[ext_resource type="PackedScene" uid="uid://bt78arqovue7l" path="res://level/geometry/models/core.glb" id="3"]
[ext_resource type="PackedScene" uid="uid://bewdyyyqeciso" path="res://level/geometry/scenes/collision/radial_player_only.tscn" id="4"]
Expand Down Expand Up @@ -195,6 +196,12 @@ size = Vector3(1.2, 1.2, 2.8)

[node name="Core" type="Node3D"]

[node name="Door" parent="." instance=ExtResource("1_d4yh0")]
transform = Transform3D(0.291538, 0, 0.95656, 0, 1, 0, -0.95656, 0, 0.291538, 40.3273, -6.17461, 12.2754)

[node name="Door2" parent="." instance=ExtResource("1_d4yh0")]
transform = Transform3D(0.291538, 0, 0.95656, 0, 1, 0, -0.95656, 0, 0.291538, 35.4583, -6.17461, 10.7914)

[node name="CoreModel" parent="." instance=ExtResource("3")]

[node name="Plasma" type="CPUParticles3D" parent="."]
Expand Down
55 changes: 49 additions & 6 deletions level/geometry/scenes/structure.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[gd_scene load_steps=37 format=3 uid="uid://bh1lh032pmey2"]
[gd_scene load_steps=38 format=3 uid="uid://bh1lh032pmey2"]

[ext_resource type="PackedScene" uid="uid://babdc0gjbduw" path="res://level/geometry/scenes/collision/stair_pillar.tscn" id="1"]
[ext_resource type="PackedScene" uid="uid://8fujwb58dav7" path="res://level/geometry/models/structure.glb" id="2"]
[ext_resource type="PackedScene" uid="uid://bcnpdinrepean" path="res://door/door.tscn" id="2_e5crn"]
[ext_resource type="ArrayOccluder3D" uid="uid://d20dpr3pj0fn6" path="res://level/geometry/scenes/occluder.occ" id="3_2aako"]

[sub_resource type="BoxShape3D" id="BoxShape3D_du13b"]
size = Vector3(3.40112, 4.49847, 1)

[sub_resource type="BoxShape3D" id="1"]
size = Vector3(12, 18, 20)

Expand Down Expand Up @@ -52,6 +56,9 @@ size = Vector3(25.2728, 1.22571, 10.7105)
[sub_resource type="BoxShape3D" id="BoxShape3D_h3fnu"]
size = Vector3(1.63623, 5.575, 9.375)

[sub_resource type="BoxShape3D" id="BoxShape3D_330pa"]
size = Vector3(28, 1, 10)

[sub_resource type="BoxShape3D" id="15"]
size = Vector3(200, 12, 200)

Expand Down Expand Up @@ -107,6 +114,42 @@ size = Vector3(1.5, 3, 7.4)

[node name="StructureModel" parent="." instance=ExtResource("2")]

[node name="littledoorimposter_001" parent="StructureModel" index="156"]
visible = false

[node name="littledoorimposter_002" parent="StructureModel" index="157"]
visible = false

[node name="littledoorimposter_003" parent="StructureModel" index="158"]
visible = false

[node name="Door3" parent="." instance=ExtResource("2_e5crn")]
transform = Transform3D(0.954579, 0, 0.29796, 0, 1, 0, -0.29796, 0, 0.954579, 30.6242, -1.23008, 100.982)
is_locked = true

[node name="CollisionShape3D4" type="CollisionShape3D" parent="Door3"]
transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 5.24426, 2.04644, -0.288971)
shape = SubResource("BoxShape3D_du13b")

[node name="CollisionShape3D5" type="CollisionShape3D" parent="Door3"]
transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, -5.34876, 2.04644, -0.288963)
shape = SubResource("BoxShape3D_du13b")

[node name="Door2" parent="." instance=ExtResource("2_e5crn")]
transform = Transform3D(0.77301, 0, 0.634393, 0, 1, 0, -0.634393, 0, 0.77301, 61.3275, -6.46153, 74.7437)
is_locked = true

[node name="Door" parent="." instance=ExtResource("2_e5crn")]
transform = Transform3D(0.77301, 0, 0.634393, 0, 1, 0, -0.634393, 0, 0.77301, 66.769, -1.23431, 81.3738)

[node name="CollisionShape3D2" type="CollisionShape3D" parent="Door"]
transform = Transform3D(1, 0, 2.98023e-08, 0, 1, 0, -2.98023e-08, 0, 1, 5.32316, 2.05067, 7.62939e-06)
shape = SubResource("BoxShape3D_du13b")

[node name="CollisionShape3D3" type="CollisionShape3D" parent="Door"]
transform = Transform3D(1, 0, 2.98023e-08, 0, 1, 0, -2.98023e-08, 0, 1, -5.37504, 2.05067, 7.62939e-06)
shape = SubResource("BoxShape3D_du13b")

[node name="StairPillar4" parent="." instance=ExtResource("1")]
transform = Transform3D(-1.09128, 0, -0.588822, 0, 1.24, 0, 0.588822, 0, -1.09128, 48.9491, 2.48, -26.4115)

Expand Down Expand Up @@ -1094,8 +1137,8 @@ transform = Transform3D(0.573576, 0, -0.819152, 0, 1, 0, 0.819152, 0, 0.573576,
shape = SubResource("12")

[node name="StartHall9" type="CollisionShape3D" parent="UpperFloor"]
transform = Transform3D(0.642788, 0, -0.766044, 0, 1, 0, 0.766044, 0, 0.642788, 70.4817, -16.2, 83.9968)
shape = SubResource("12")
transform = Transform3D(0.642788, 0, -0.766044, 0, 1, 0, 0.766044, 0, 0.642788, 70.482, -1.7, 83.997)
shape = SubResource("BoxShape3D_330pa")

[node name="StartHall10" type="CollisionShape3D" parent="UpperFloor"]
transform = Transform3D(0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 77.5342, -16.2, 77.5343)
Expand Down Expand Up @@ -1392,11 +1435,11 @@ transform = Transform3D(0.173648, 0, -0.984808, 0, 1, 0, 0.984808, 0, 0.173648,
shape = SubResource("12")

[node name="StartHall4" type="CollisionShape3D" parent="OuterWalls"]
transform = Transform3D(0.258819, 0, -0.965926, 0, 1, 0, 0.965926, 0, 0.258819, 30.6442, 13.8, 114.366)
transform = Transform3D(0.258819, 0, -0.965926, 0, 1, 0, 0.965926, 0, 0.258819, 30.6442, 17.5782, 114.366)
shape = SubResource("12")

[node name="StartHall5" type="CollisionShape3D" parent="OuterWalls"]
transform = Transform3D(0.34202, 0, -0.939693, 0, 1, 0, 0.939693, 0, 0.34202, 40.4952, 13.8, 111.259)
transform = Transform3D(0.34202, 0, -0.939693, 0, 1, 0, 0.939693, 0, 0.34202, 40.4952, 17.5782, 111.259)
shape = SubResource("12")

[node name="StartHall6" type="CollisionShape3D" parent="OuterWalls"]
Expand All @@ -1412,7 +1455,7 @@ transform = Transform3D(0.573576, 0, -0.819152, 0, 1, 0, 0.819152, 0, 0.573576,
shape = SubResource("12")

[node name="StartHall9" type="CollisionShape3D" parent="OuterWalls"]
transform = Transform3D(0.642788, 0, -0.766044, 0, 1, 0, 0.766044, 0, 0.642788, 76.1061, 13.8, 90.6997)
transform = Transform3D(0.642788, 0, -0.766044, 0, 1, 0, 0.766044, 0, 0.642788, 76.1061, 17.7633, 90.6997)
shape = SubResource("12")

[node name="StartHall10" type="CollisionShape3D" parent="OuterWalls"]
Expand Down
5 changes: 1 addition & 4 deletions player/bullet/effect/BlastMaterial.tres
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://bxjcw6j767jtn"]

[ext_resource type="Texture2D" uid="uid://bpm6frbylo5an" path="res://effects_shared/BlastTexture.png" id="1_1ujtj"]
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://bxjcw6j767jtn"]

[sub_resource type="Shader" id="1"]
code = "shader_type spatial;
Expand Down Expand Up @@ -56,4 +54,3 @@ shader_parameter/uv1_scale = Vector3(1, 1, 1)
shader_parameter/uv1_offset = Vector3(0, 0, 0)
shader_parameter/uv2_scale = Vector3(1, 1, 1)
shader_parameter/uv2_offset = Vector3(0, 0, 0)
shader_parameter/texture_albedo = ExtResource("1_1ujtj")

0 comments on commit fd6c140

Please sign in to comment.