Enemy follow system
This commit is contained in:
@@ -84,6 +84,12 @@ Throw={
|
|||||||
3d_physics/layer_5="Weapon"
|
3d_physics/layer_5="Weapon"
|
||||||
3d_physics/layer_6="Alert"
|
3d_physics/layer_6="Alert"
|
||||||
|
|
||||||
|
[navigation]
|
||||||
|
|
||||||
|
3d/default_cell_size=0.75
|
||||||
|
3d/merge_rasterizer_cell_scale=0.1
|
||||||
|
3d/default_edge_connection_margin=0.75
|
||||||
|
|
||||||
[physics]
|
[physics]
|
||||||
|
|
||||||
3d/run_on_separate_thread=true
|
3d/run_on_separate_thread=true
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ public interface IEnemy : ICharacterBody3D
|
|||||||
public int CurrentHP { get; set; }
|
public int CurrentHP { get; set; }
|
||||||
|
|
||||||
public Resource EnemyStats { get; set; }
|
public Resource EnemyStats { get; set; }
|
||||||
|
|
||||||
|
public NavigationAgent3D NavAgent { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Meta(typeof(IAutoNode))]
|
[Meta(typeof(IAutoNode))]
|
||||||
@@ -37,6 +39,8 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
|||||||
|
|
||||||
public int CurrentHP { get; set; }
|
public int CurrentHP { get; set; }
|
||||||
|
|
||||||
|
[Node] public NavigationAgent3D NavAgent { get; set; } = default!;
|
||||||
|
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
EnemyLogic = new EnemyLogic();
|
EnemyLogic = new EnemyLogic();
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ collision_mask = 9
|
|||||||
script = ExtResource("1_yhru4")
|
script = ExtResource("1_yhru4")
|
||||||
EnemyStats = ExtResource("2_8ue4i")
|
EnemyStats = ExtResource("2_8ue4i")
|
||||||
|
|
||||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
[node name="NavAgent" type="NavigationAgent3D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
radius = 5.0
|
radius = 5.0
|
||||||
debug_enabled = true
|
debug_enabled = true
|
||||||
@@ -163,7 +163,6 @@ shape = SubResource("CapsuleShape3D_p0yqe")
|
|||||||
|
|
||||||
[node name="Sprite" type="AnimatedSprite3D" parent="."]
|
[node name="Sprite" type="AnimatedSprite3D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
|
|
||||||
flip_h = true
|
flip_h = true
|
||||||
pixel_size = 0.015
|
pixel_size = 0.015
|
||||||
billboard = 2
|
billboard = 2
|
||||||
|
|||||||
@@ -3,10 +3,6 @@
|
|||||||
[ext_resource type="Script" path="res://src/enemy/Enemy.cs" id="1_4d86o"]
|
[ext_resource type="Script" path="res://src/enemy/Enemy.cs" id="1_4d86o"]
|
||||||
[ext_resource type="Resource" uid="uid://bcsyqy7rmbpbl" path="res://src/enemy/enemy_types/FloatingEnemy.tres" id="2_q8v6p"]
|
[ext_resource type="Resource" uid="uid://bcsyqy7rmbpbl" path="res://src/enemy/enemy_types/FloatingEnemy.tres" id="2_q8v6p"]
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"]
|
|
||||||
radius = 0.25
|
|
||||||
height = 1.0
|
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5tio6"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5tio6"]
|
||||||
resource_name = "Material.001"
|
resource_name = "Material.001"
|
||||||
cull_mode = 2
|
cull_mode = 2
|
||||||
@@ -104,6 +100,10 @@ _surfaces = [{
|
|||||||
blend_shape_mode = 0
|
blend_shape_mode = 0
|
||||||
shadow_mesh = SubResource("ArrayMesh_2wch8")
|
shadow_mesh = SubResource("ArrayMesh_2wch8")
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"]
|
||||||
|
radius = 0.2
|
||||||
|
height = 1.0
|
||||||
|
|
||||||
[node name="EnemyGuy" type="CharacterBody3D"]
|
[node name="EnemyGuy" type="CharacterBody3D"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
||||||
collision_layer = 10
|
collision_layer = 10
|
||||||
@@ -112,20 +112,18 @@ motion_mode = 1
|
|||||||
script = ExtResource("1_4d86o")
|
script = ExtResource("1_4d86o")
|
||||||
EnemyStats = ExtResource("2_q8v6p")
|
EnemyStats = ExtResource("2_q8v6p")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
|
||||||
shape = SubResource("CapsuleShape3D_cwfph")
|
|
||||||
|
|
||||||
[node name="DISSAPPEARING ENEMY" type="Node3D" parent="."]
|
[node name="DISSAPPEARING ENEMY" type="Node3D" parent="."]
|
||||||
|
|
||||||
[node name="BezierCurve_001" type="MeshInstance3D" parent="DISSAPPEARING ENEMY"]
|
[node name="BezierCurve_001" type="MeshInstance3D" parent="DISSAPPEARING ENEMY"]
|
||||||
transform = Transform3D(-7.57406e-09, -0.203117, 0, 0.173274, -8.87853e-09, 0, 0, 0, 0.203825, 0, 0, 0)
|
transform = Transform3D(-6.8248e-09, -0.183024, -0.0883906, 0.173274, -8.87853e-09, 0, -3.28455e-09, -0.0880835, 0.183662, 0, 0, 0)
|
||||||
mesh = SubResource("ArrayMesh_w2sup")
|
mesh = SubResource("ArrayMesh_w2sup")
|
||||||
skeleton = NodePath("")
|
skeleton = NodePath("")
|
||||||
|
|
||||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
[node name="NavAgent" type="NavigationAgent3D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
simplify_path = true
|
|
||||||
avoidance_enabled = true
|
avoidance_enabled = true
|
||||||
radius = 5.0
|
|
||||||
debug_enabled = true
|
debug_enabled = true
|
||||||
debug_path_custom_color = Color(1, 0, 0, 1)
|
debug_path_custom_color = Color(1, 0, 0, 1)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||||
|
shape = SubResource("CapsuleShape3D_cwfph")
|
||||||
|
|||||||
@@ -15,6 +15,19 @@ namespace GameJamDungeon
|
|||||||
var delta = input.Delta;
|
var delta = input.Delta;
|
||||||
var gameRepo = Get<IGameRepo>();
|
var gameRepo = Get<IGameRepo>();
|
||||||
var enemy = Get<IEnemy>();
|
var enemy = Get<IEnemy>();
|
||||||
|
|
||||||
|
if (enemy.GlobalPosition.DistanceTo(gameRepo.PlayerGlobalPosition.Value) <= 2.5f)
|
||||||
|
{
|
||||||
|
enemy.LookAt(new Vector3(gameRepo.PlayerGlobalPosition.Value.X, enemy.GlobalPosition.Y, gameRepo.PlayerGlobalPosition.Value.Z), Vector3.Up);
|
||||||
|
return ToSelf();
|
||||||
|
}
|
||||||
|
enemy.NavAgent.TargetPosition = gameRepo.PlayerGlobalPosition.Value;
|
||||||
|
var nextPosition = enemy.NavAgent.GetNextPathPosition();
|
||||||
|
enemy.LookAt(enemy.NavAgent.GetNextPathPosition());
|
||||||
|
|
||||||
|
var direction = enemy.NavAgent.GetNextPathPosition() - enemy.GlobalPosition;
|
||||||
|
enemy.Velocity = direction * 2.0f * (float)delta;
|
||||||
|
|
||||||
Output(new Output.MovementComputed(enemy.Velocity));
|
Output(new Output.MovementComputed(enemy.Velocity));
|
||||||
|
|
||||||
return ToSelf();
|
return ToSelf();
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ public partial class Game : Node3D, IGame
|
|||||||
|
|
||||||
[Node] public Control MiniMap { get; set; } = default!;
|
[Node] public Control MiniMap { get; set; } = default!;
|
||||||
|
|
||||||
|
[Node] public NavigationRegion3D NavigationRegion { get; set; } = default!;
|
||||||
|
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
GameRepo = new GameRepo();
|
GameRepo = new GameRepo();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=11 format=3 uid="uid://33ek675mfb5n"]
|
[gd_scene load_steps=12 format=3 uid="uid://33ek675mfb5n"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://src/game/Game.cs" id="1_ytcii"]
|
[ext_resource type="Script" path="res://src/game/Game.cs" id="1_ytcii"]
|
||||||
[ext_resource type="PackedScene" uid="uid://wg25dg65ksgg" path="res://src/map/dungeon/DungeonGenerator.tscn" id="2_cgboj"]
|
[ext_resource type="PackedScene" uid="uid://wg25dg65ksgg" path="res://src/map/dungeon/DungeonGenerator.tscn" id="2_cgboj"]
|
||||||
@@ -16,6 +16,8 @@ size = Vector2(10, 10)
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_s2hwi"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_s2hwi"]
|
||||||
size = Vector3(10, 1, 10)
|
size = Vector3(10, 1, 10)
|
||||||
|
|
||||||
|
[sub_resource type="NavigationMesh" id="NavigationMesh_xligp"]
|
||||||
|
|
||||||
[node name="Game" type="Node3D"]
|
[node name="Game" type="Node3D"]
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
script = ExtResource("1_ytcii")
|
script = ExtResource("1_ytcii")
|
||||||
@@ -51,7 +53,11 @@ layers = 3
|
|||||||
omni_range = 163.618
|
omni_range = 163.618
|
||||||
omni_attenuation = -0.183
|
omni_attenuation = -0.183
|
||||||
|
|
||||||
[node name="DungeonGenerator3D" parent="." instance=ExtResource("2_cgboj")]
|
[node name="NavigationRegion" type="NavigationRegion3D" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
navigation_mesh = SubResource("NavigationMesh_xligp")
|
||||||
|
|
||||||
|
[node name="DungeonGenerator3D" parent="NavigationRegion" instance=ExtResource("2_cgboj")]
|
||||||
room_scenes = Array[PackedScene]([ExtResource("4_56rmd"), ExtResource("4_clpvl")])
|
room_scenes = Array[PackedScene]([ExtResource("4_56rmd"), ExtResource("4_clpvl")])
|
||||||
corridor_cost_multiplier = 1.0
|
corridor_cost_multiplier = 1.0
|
||||||
room_cost_multiplier = 8.0
|
room_cost_multiplier = 8.0
|
||||||
|
|||||||
@@ -7,6 +7,21 @@
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_qihtb"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_qihtb"]
|
||||||
size = Vector3(0.371643, 0.289612, 0.286743)
|
size = Vector3(0.371643, 0.289612, 0.286743)
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_d22ed"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Hitbox: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, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_7gvmx"]
|
[sub_resource type="Animation" id="Animation_7gvmx"]
|
||||||
resource_name = "throw"
|
resource_name = "throw"
|
||||||
length = 2.0
|
length = 2.0
|
||||||
@@ -23,21 +38,6 @@ tracks/0/keys = {
|
|||||||
"values": [Vector3(0, 1, 0), Vector3(0, 1, -15)]
|
"values": [Vector3(0, 1, 0), Vector3(0, 1, -15)]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_d22ed"]
|
|
||||||
length = 0.001
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("Hitbox: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, 0)]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_qfght"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_qfght"]
|
||||||
_data = {
|
_data = {
|
||||||
"RESET": SubResource("Animation_d22ed"),
|
"RESET": SubResource("Animation_d22ed"),
|
||||||
|
|||||||
@@ -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="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="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"]
|
[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"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_kdikn"]
|
||||||
albedo_color = Color(1, 1, 0, 1)
|
albedo_color = Color(1, 1, 0, 1)
|
||||||
|
|
||||||
@@ -16,6 +24,22 @@ script = ExtResource("1_y0rqi")
|
|||||||
[node name="RemoveUnusedDoors" type="Node" parent="."]
|
[node name="RemoveUnusedDoors" type="Node" parent="."]
|
||||||
script = ExtResource("3_8i1ij")
|
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="."]
|
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||||
use_collision = true
|
use_collision = true
|
||||||
size = Vector3(10, 10, 10)
|
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://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_0tfda"]
|
||||||
[ext_resource type="Script" path="res://src/map/dungeon/rooms/DungeonRoom.cs" id="1_ti7ur"]
|
[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://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"]
|
[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"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_nin6j"]
|
||||||
albedo_color = Color(1, 0, 0.0784314, 1)
|
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"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_05l2p"]
|
||||||
albedo_color = Color(1, 0, 0.0784314, 1)
|
albedo_color = Color(1, 0, 0.0784314, 1)
|
||||||
|
|
||||||
[sub_resource type="PlaneMesh" id="PlaneMesh_luhnj"]
|
[sub_resource type="NavigationMesh" id="NavigationMesh_2klpp"]
|
||||||
size = Vector2(10, 10)
|
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"]
|
[node name="DungeonRoom3D" type="Node3D"]
|
||||||
script = ExtResource("1_0tfda")
|
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="."]
|
[node name="DungeonRoom" type="Node3D" parent="."]
|
||||||
script = ExtResource("1_ti7ur")
|
script = ExtResource("1_ti7ur")
|
||||||
|
|
||||||
@@ -79,3 +67,34 @@ unique_name_in_owner = true
|
|||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
EnemyList = Array[PackedScene]([ExtResource("5_urvkv"), ExtResource("6_hp0mx")])
|
EnemyList = Array[PackedScene]([ExtResource("5_urvkv"), ExtResource("6_hp0mx")])
|
||||||
SpawnRate = PackedFloat32Array(0.1, 0.9)
|
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://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_o02dd"]
|
||||||
[ext_resource type="Script" path="res://src/map/dungeon/rooms/DungeonRoom.cs" id="2_jrlll"]
|
[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"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ham86"]
|
||||||
albedo_color = Color(0.0470588, 0, 1, 1)
|
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"]
|
[node name="DungeonRoom3D" type="Node3D"]
|
||||||
script = ExtResource("1_o02dd")
|
script = ExtResource("1_o02dd")
|
||||||
size_in_voxels = Vector3i(5, 1, 1)
|
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)
|
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)
|
size = Vector3(4, 4, 1)
|
||||||
material = SubResource("StandardMaterial3D_ham86")
|
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