mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-20 00:33:48 +00:00
Moved player detection to external script
This commit is contained in:
parent
6968bbe72b
commit
d8e1459194
8 changed files with 237 additions and 69 deletions
|
|
@ -1,8 +1,9 @@
|
|||
[gd_scene load_steps=10 format=3 uid="uid://v8s3kubgb2qg"]
|
||||
[gd_scene load_steps=11 format=3 uid="uid://v8s3kubgb2qg"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b4ynnb14mb4uq" path="res://Sprites/Reisen.png" id="1_4w8mj"]
|
||||
[ext_resource type="Script" path="res://Scripts/Enemy.cs" id="1_lpwdj"]
|
||||
[ext_resource type="PackedScene" uid="uid://cuixq5ex0j40h" path="res://Scenes/enemyBullet.tscn" id="2_ogldd"]
|
||||
[ext_resource type="Script" path="res://Scripts/Components/ProximityPlayerDetection.cs" id="3_1nqn5"]
|
||||
[ext_resource type="PackedScene" uid="uid://crry0rgk7a8sm" path="res://Scenes/Weapons/BaseWeapon.tscn" id="4_2k1dv"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2brqc"]
|
||||
|
|
@ -21,11 +22,12 @@ radius = 85.0529
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_m1rsg"]
|
||||
size = Vector2(8, 12)
|
||||
|
||||
[node name="Enemy" type="CharacterBody2D" node_paths=PackedStringArray("EquippedWeapon") groups=["Destroyable"]]
|
||||
[node name="Enemy" type="CharacterBody2D" node_paths=PackedStringArray("EquippedWeapon", "_playerDetection") groups=["Destroyable"]]
|
||||
collision_layer = 16
|
||||
collision_mask = 9
|
||||
script = ExtResource("1_lpwdj")
|
||||
EquippedWeapon = NodePath("Weapon")
|
||||
_playerDetection = NodePath("PlayerDetection")
|
||||
NavigationEnabled = true
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
|
|
@ -48,6 +50,7 @@ shape = SubResource("CircleShape2D_cacb5")
|
|||
visible = false
|
||||
collision_layer = 16
|
||||
collision_mask = 2
|
||||
script = ExtResource("3_1nqn5")
|
||||
|
||||
[node name="PlayerDetectionArea" type="CollisionShape2D" parent="PlayerDetection"]
|
||||
shape = SubResource("CircleShape2D_v711r")
|
||||
|
|
@ -76,7 +79,7 @@ collision_mask = 9
|
|||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageHitbox"]
|
||||
shape = SubResource("RectangleShape2D_m1rsg")
|
||||
|
||||
[connection signal="area_entered" from="PlayerDetection" to="." method="_on_player_detection_area_entered"]
|
||||
[connection signal="area_exited" from="PlayerDetection" to="." method="_on_player_detection_area_exited"]
|
||||
[connection signal="area_entered" from="PlayerDetection" to="PlayerDetection" method="_on_area_entered"]
|
||||
[connection signal="area_exited" from="PlayerDetection" to="PlayerDetection" method="_on_area_exited"]
|
||||
[connection signal="velocity_computed" from="NavigationAgent2D" to="." method="_on_navigation_agent_2d_velocity_computed"]
|
||||
[connection signal="area_entered" from="DamageHitbox" to="." method="_on_damage_hitbox_area_entered"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue