Make enemy shots smaller
This commit is contained in:
@@ -1,20 +1,17 @@
|
|||||||
[gd_scene load_steps=6 format=3 uid="uid://rlxnnw4yay7e"]
|
[gd_scene load_steps=5 format=3 uid="uid://rlxnnw4yay7e"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Enemies/Attacks/EnemyBullet.cs" id="1_rv13r"]
|
[ext_resource type="Script" path="res://Enemies/Attacks/EnemyBullet.cs" id="1_rv13r"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dd71tdgrgic46" path="res://Textures/Projectiles/LB ORB.png" id="2_6l2aj"]
|
[ext_resource type="Texture2D" uid="uid://dd71tdgrgic46" path="res://Textures/Projectiles/LB ORB.png" id="2_6l2aj"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://cfj82os5p8i4p" path="res://Audio/SFX/shooting.wav" id="2_q6wdf"]
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_phgri"]
|
|
||||||
albedo_color = Color(0.584314, 0.0352941, 0.141176, 1)
|
|
||||||
|
|
||||||
[sub_resource type="SphereMesh" id="SphereMesh_wuk0e"]
|
|
||||||
material = SubResource("StandardMaterial3D_phgri")
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_e4v7f"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_e4v7f"]
|
||||||
|
height = 8.99869
|
||||||
radius = 0.4
|
radius = 0.4
|
||||||
|
|
||||||
[node name="TestBullet" type="Node3D"]
|
[node name="TestBullet" type="Node3D"]
|
||||||
script = ExtResource("1_rv13r")
|
script = ExtResource("1_rv13r")
|
||||||
_projectileSpeed = 3.0
|
Cooldown = 3.0
|
||||||
|
_soundEffect = ExtResource("2_q6wdf")
|
||||||
|
|
||||||
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
@@ -26,18 +23,12 @@ max_contacts_reported = 10
|
|||||||
contact_monitor = true
|
contact_monitor = true
|
||||||
can_sleep = false
|
can_sleep = false
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D"]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.02602, 0)
|
|
||||||
visible = false
|
|
||||||
mesh = SubResource("SphereMesh_wuk0e")
|
|
||||||
skeleton = NodePath("../..")
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0111055, 1.02602, 0)
|
transform = Transform3D(0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0.0111055, 1.02602, 0)
|
||||||
shape = SubResource("CylinderShape3D_e4v7f")
|
shape = SubResource("CylinderShape3D_e4v7f")
|
||||||
|
|
||||||
[node name="Sprite3D" type="Sprite3D" parent="RigidBody3D"]
|
[node name="Sprite3D" type="Sprite3D" parent="RigidBody3D/CollisionShape3D"]
|
||||||
transform = Transform3D(0.08, 0, 0, 0, 0.08, 0, 0, 0, 0.08, -0.379318, 1.02602, 0.436329)
|
transform = Transform3D(0.08, 0, 0, 0, 0.08, 0, 0, 0, 0.08, -0.390424, 0, 0.436329)
|
||||||
centered = false
|
centered = false
|
||||||
axis = 1
|
axis = 1
|
||||||
texture = ExtResource("2_6l2aj")
|
texture = ExtResource("2_6l2aj")
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public partial class RangedEnemy : BasicEnemy
|
|||||||
var convertedPlayers = players.Select(x => (Node3D)x);
|
var convertedPlayers = players.Select(x => (Node3D)x);
|
||||||
var target = convertedPlayers.OrderBy(x => Position.DistanceTo(x.Position)).FirstOrDefault();
|
var target = convertedPlayers.OrderBy(x => Position.DistanceTo(x.Position)).FirstOrDefault();
|
||||||
var area = GetChildren().OfType<Area3D>().Single();
|
var area = GetChildren().OfType<Area3D>().Single();
|
||||||
area.LookAt(target.Position, Vector3.Up);
|
area.LookAt(new Vector3(target.Position.X, 0, target.Position.Z), Vector3.Up);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user