Enemy follow system
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://bn4gslp2gk8ds"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://bn4gslp2gk8ds"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_y0rqi"]
|
||||
[ext_resource type="PackedScene" uid="uid://ckaw6wjmi0fom" path="res://src/map/dungeon/door/Door.tscn" id="2_vpnlr"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="3_8i1ij"]
|
||||
|
||||
[sub_resource type="NavigationMesh" id="NavigationMesh_j0j2w"]
|
||||
vertices = PackedVector3Array(-1.42783, -3.84337, 1.82217, -1.42783, -3.84337, 5.07217, 1.32217, -3.84337, 5.07217, 1.57217, -3.84337, 1.57217, 1.32217, -3.84337, -1.42783, -1.67783, -3.84337, -1.17783, 5.07217, -3.84337, 1.57217, 5.07217, -3.84337, -1.17783, 1.32217, -3.84337, -5.17783, -1.42783, -3.84337, -5.17783, -5.17783, -3.84337, -1.17783, -5.17783, -3.84337, 1.57217)
|
||||
polygons = [PackedInt32Array(1, 0, 2), PackedInt32Array(2, 0, 3), PackedInt32Array(3, 0, 4), PackedInt32Array(4, 0, 5), PackedInt32Array(6, 3, 7), PackedInt32Array(7, 3, 4), PackedInt32Array(8, 4, 9), PackedInt32Array(9, 4, 5), PackedInt32Array(10, 5, 11), PackedInt32Array(11, 5, 0)]
|
||||
agent_radius = 0.25
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_r6hgf"]
|
||||
size = Vector3(3.00739, 1, 10.7051)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_kdikn"]
|
||||
albedo_color = Color(1, 1, 0, 1)
|
||||
|
||||
@@ -16,6 +24,22 @@ script = ExtResource("1_y0rqi")
|
||||
[node name="RemoveUnusedDoors" type="Node" parent="."]
|
||||
script = ExtResource("3_8i1ij")
|
||||
|
||||
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
|
||||
navigation_mesh = SubResource("NavigationMesh_j0j2w")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="NavigationRegion3D"]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/StaticBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.144196, -4.84337, -0.0752945)
|
||||
shape = SubResource("BoxShape3D_r6hgf")
|
||||
|
||||
[node name="StaticBody3D2" type="StaticBody3D" parent="NavigationRegion3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/StaticBody3D2"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.144196, -4.84337, -0.0752945)
|
||||
shape = SubResource("BoxShape3D_r6hgf")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
use_collision = true
|
||||
size = Vector3(10, 10, 10)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://dhpwwqow1ahrc"]
|
||||
[gd_scene load_steps=15 format=3 uid="uid://dhpwwqow1ahrc"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_0tfda"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/rooms/DungeonRoom.cs" id="1_ti7ur"]
|
||||
@@ -8,6 +8,9 @@
|
||||
[ext_resource type="PackedScene" uid="uid://dcgj5i52i76gj" path="res://src/enemy/enemy_types/FloatingEnemy.tscn" id="5_urvkv"]
|
||||
[ext_resource type="PackedScene" uid="uid://u1vmmakcoplh" path="res://src/enemy/enemy_types/Capricorn/Capricorn.tscn" id="6_hp0mx"]
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_luhnj"]
|
||||
size = Vector2(10, 10)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_nin6j"]
|
||||
albedo_color = Color(1, 0, 0.0784314, 1)
|
||||
|
||||
@@ -20,33 +23,18 @@ albedo_color = Color(1, 0, 0.0784314, 1)
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_05l2p"]
|
||||
albedo_color = Color(1, 0, 0.0784314, 1)
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_luhnj"]
|
||||
size = Vector2(10, 10)
|
||||
[sub_resource type="NavigationMesh" id="NavigationMesh_2klpp"]
|
||||
vertices = PackedVector3Array(-0.842159, -3.84337, -5.27783, -0.842159, -3.84337, 5.07217, 1.85784, -3.84337, 5.07217, 1.85784, -3.84337, -5.27783)
|
||||
polygons = [PackedInt32Array(3, 2, 0), PackedInt32Array(0, 2, 1)]
|
||||
cell_size = 0.15
|
||||
agent_radius = 0.15
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_4exnc"]
|
||||
size = Vector3(3.00739, 1, 10.7051)
|
||||
|
||||
[node name="DungeonRoom3D" type="Node3D"]
|
||||
script = ExtResource("1_0tfda")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
use_collision = true
|
||||
size = Vector3(10, 10, 10)
|
||||
material = SubResource("StandardMaterial3D_nin6j")
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGBox3D"]
|
||||
operation = 2
|
||||
use_collision = true
|
||||
size = Vector3(9, 9, 9)
|
||||
material = SubResource("StandardMaterial3D_5j6ws")
|
||||
|
||||
[node name="DOOR" parent="CSGBox3D" instance=ExtResource("2_mdawx")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.563568, -2.54039, 4.74571)
|
||||
size = Vector3(4, 4, 1)
|
||||
material = SubResource("StandardMaterial3D_it7n4")
|
||||
|
||||
[node name="DOOR2" parent="CSGBox3D" instance=ExtResource("2_mdawx")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.58282, -4.73548)
|
||||
size = Vector3(4, 4, 1)
|
||||
material = SubResource("StandardMaterial3D_05l2p")
|
||||
|
||||
[node name="DungeonRoom" type="Node3D" parent="."]
|
||||
script = ExtResource("1_ti7ur")
|
||||
|
||||
@@ -79,3 +67,34 @@ unique_name_in_owner = true
|
||||
unique_name_in_owner = true
|
||||
EnemyList = Array[PackedScene]([ExtResource("5_urvkv"), ExtResource("6_hp0mx")])
|
||||
SpawnRate = PackedFloat32Array(0.1, 0.9)
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
use_collision = true
|
||||
size = Vector3(10, 10, 10)
|
||||
material = SubResource("StandardMaterial3D_nin6j")
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGBox3D"]
|
||||
operation = 2
|
||||
use_collision = true
|
||||
size = Vector3(9, 9, 9)
|
||||
material = SubResource("StandardMaterial3D_5j6ws")
|
||||
|
||||
[node name="DOOR" parent="CSGBox3D" instance=ExtResource("2_mdawx")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.563568, -2.54039, 4.74571)
|
||||
size = Vector3(4, 4, 1)
|
||||
material = SubResource("StandardMaterial3D_it7n4")
|
||||
|
||||
[node name="DOOR2" parent="CSGBox3D" instance=ExtResource("2_mdawx")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.58282, -4.73548)
|
||||
size = Vector3(4, 4, 1)
|
||||
material = SubResource("StandardMaterial3D_05l2p")
|
||||
|
||||
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
|
||||
navigation_mesh = SubResource("NavigationMesh_2klpp")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="NavigationRegion3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.655729, 0, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/StaticBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.144196, -4.84337, -0.0752945)
|
||||
shape = SubResource("BoxShape3D_4exnc")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://bbwgmqy3evhh2"]
|
||||
[gd_scene load_steps=14 format=3 uid="uid://bbwgmqy3evhh2"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_o02dd"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/rooms/DungeonRoom.cs" id="2_jrlll"]
|
||||
@@ -21,6 +21,18 @@ albedo_color = Color(0.0470588, 0, 1, 1)
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ham86"]
|
||||
albedo_color = Color(0.0470588, 0, 1, 1)
|
||||
|
||||
[sub_resource type="NavigationMesh" id="NavigationMesh_3rglr"]
|
||||
vertices = PackedVector3Array(-24.9253, -3.84337, -1.20581, -24.9253, -3.84337, 1.64419, -22.6753, -3.84337, 1.64419, -22.6753, -3.84337, -1.20581, -22.5253, -3.84337, 2.99419, 22.3247, -3.84337, 2.99419, 22.4747, -3.84337, 1.49419, 22.3247, -3.84337, -2.70581, -22.5253, -3.84337, -2.70581, 24.7247, -3.84337, 1.49419, 24.7247, -3.84337, -1.35581, 22.4747, -3.84337, -1.35581)
|
||||
polygons = [PackedInt32Array(3, 2, 0), PackedInt32Array(0, 2, 1), PackedInt32Array(3, 8, 4), PackedInt32Array(4, 8, 7), PackedInt32Array(4, 7, 6), PackedInt32Array(4, 6, 5), PackedInt32Array(11, 10, 6), PackedInt32Array(6, 10, 9), PackedInt32Array(4, 2, 3), PackedInt32Array(7, 11, 6)]
|
||||
cell_size = 0.15
|
||||
agent_radius = 0.15
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_tph0j"]
|
||||
size = Vector3(3, 1, 50)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_q0wqs"]
|
||||
size = Vector3(6, 1, 45)
|
||||
|
||||
[node name="DungeonRoom3D" type="Node3D"]
|
||||
script = ExtResource("1_o02dd")
|
||||
size_in_voxels = Vector3i(5, 1, 1)
|
||||
@@ -89,3 +101,20 @@ material = SubResource("StandardMaterial3D_u3mvg")
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -24.578, -2.5, 0)
|
||||
size = Vector3(4, 4, 1)
|
||||
material = SubResource("StandardMaterial3D_ham86")
|
||||
|
||||
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
|
||||
navigation_mesh = SubResource("NavigationMesh_3rglr")
|
||||
|
||||
[node name="StaticBody3D2" type="StaticBody3D" parent="NavigationRegion3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/StaticBody3D2"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.144196, -4.84337, -0.0752945)
|
||||
shape = SubResource("BoxShape3D_tph0j")
|
||||
|
||||
[node name="StaticBody3D3" type="StaticBody3D" parent="NavigationRegion3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/StaticBody3D3"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.144196, -4.84337, -0.0752945)
|
||||
shape = SubResource("BoxShape3D_q0wqs")
|
||||
|
||||
Reference in New Issue
Block a user