Remove detection spheres
This commit is contained in:
@@ -31,10 +31,6 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
||||
[Export]
|
||||
public Resource EnemyStats { get; set; } = new();
|
||||
|
||||
[Node] public Area3D DetectionSphere { get; set; } = default!;
|
||||
|
||||
[Node] public Area3D AlertedSphere { get; set; } = default!;
|
||||
|
||||
public static PackedScene CollisionDetectorScene => GD.Load<PackedScene>("res://src/enemy/CollisionDetector.tscn");
|
||||
|
||||
public static Area3D CollisionDetector { get; set; } = default!;
|
||||
@@ -53,8 +49,6 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
||||
{
|
||||
var enemyResource = EnemyStats as EnemyStats;
|
||||
CurrentHP = enemyResource.MaximumHP;
|
||||
DetectionSphere.BodyEntered += OnDetectionSphereEntered;
|
||||
AlertedSphere.BodyExited += OnAlertedSphereExited;
|
||||
}
|
||||
|
||||
public void OnResolved()
|
||||
@@ -122,18 +116,6 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDetectionSphereEntered(Node3D body)
|
||||
{
|
||||
GD.Print($"Detected {body.Name}...");
|
||||
EnemyLogic.Input(new EnemyLogic.Input.Alerted());
|
||||
}
|
||||
|
||||
public void OnAlertedSphereExited(Node3D body)
|
||||
{
|
||||
GD.Print($"Lost track of {body.Name}...");
|
||||
EnemyLogic.Input(new EnemyLogic.Input.LostPlayer());
|
||||
}
|
||||
|
||||
public void OnReady()
|
||||
{
|
||||
SetPhysicsProcess(true);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=26 format=3 uid="uid://u1vmmakcoplh"]
|
||||
[gd_scene load_steps=24 format=3 uid="uid://u1vmmakcoplh"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/enemy/Enemy.cs" id="1_yhru4"]
|
||||
[ext_resource type="Texture2D" uid="uid://eqmjpiaec28" path="res://src/enemy/enemy_types/Capricorn/sprites/GameJam_DevilCapricorn_WalkForward.png" id="2_3b07r"]
|
||||
@@ -9,12 +9,6 @@
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_p0yqe"]
|
||||
radius = 1.0
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_3pxe5"]
|
||||
radius = 5.0
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_fva4b"]
|
||||
radius = 7.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_blequ"]
|
||||
atlas = ExtResource("3_jdsw3")
|
||||
region = Rect2(0, 0, 120, 132)
|
||||
@@ -167,24 +161,6 @@ debug_path_custom_color = Color(1, 0, 0, 1)
|
||||
transform = Transform3D(1, 0, 1.06581e-14, 0, 1, 0, -1.06581e-14, 0, 1, 0, 0, 0)
|
||||
shape = SubResource("CapsuleShape3D_p0yqe")
|
||||
|
||||
[node name="DetectionSphere" type="Area3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 0.689022, 0, -2.13941)
|
||||
collision_layer = 0
|
||||
collision_mask = 32
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="DetectionSphere"]
|
||||
shape = SubResource("SphereShape3D_3pxe5")
|
||||
|
||||
[node name="AlertedSphere" type="Area3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 0.689022, 0, -2.13941)
|
||||
collision_layer = 0
|
||||
collision_mask = 32
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="AlertedSphere"]
|
||||
shape = SubResource("SphereShape3D_fva4b")
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=11 format=4 uid="uid://dcgj5i52i76gj"]
|
||||
[gd_scene load_steps=9 format=4 uid="uid://dcgj5i52i76gj"]
|
||||
|
||||
[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"]
|
||||
@@ -104,12 +104,6 @@ _surfaces = [{
|
||||
blend_shape_mode = 0
|
||||
shadow_mesh = SubResource("ArrayMesh_2wch8")
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_wi5jl"]
|
||||
radius = 11.037
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_ijaea"]
|
||||
radius = 48.442
|
||||
|
||||
[node name="EnemyGuy" type="CharacterBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
||||
collision_layer = 10
|
||||
@@ -128,22 +122,6 @@ transform = Transform3D(-7.57406e-09, -0.203117, 0, 0.173274, -8.87853e-09, 0, 0
|
||||
mesh = SubResource("ArrayMesh_w2sup")
|
||||
skeleton = NodePath("")
|
||||
|
||||
[node name="DetectionSphere" type="Area3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 0
|
||||
collision_mask = 32
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="DetectionSphere"]
|
||||
shape = SubResource("SphereShape3D_wi5jl")
|
||||
|
||||
[node name="AlertedSphere" type="Area3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 0
|
||||
collision_mask = 32
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="AlertedSphere"]
|
||||
shape = SubResource("SphereShape3D_ijaea")
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
simplify_path = true
|
||||
|
||||
Reference in New Issue
Block a user