1
Fork 0
mirror of https://github.com/RYGhub/the-cold-night.git synced 2024-11-22 04:34:19 +00:00

🔧 Free enemy on death

This commit is contained in:
Steffo 2022-04-03 09:06:30 +02:00
parent 431255dd13
commit da81aa103e
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 10 additions and 1 deletions

5
src/entities/Enemy.gd Normal file
View file

@ -0,0 +1,5 @@
extends KinematicBody2D
func _on_Damageable_dead():
queue_free()

View file

@ -1,16 +1,18 @@
[gd_scene load_steps=7 format=2] [gd_scene load_steps=8 format=2]
[ext_resource path="res://src/mechanics/Black.png" type="Texture" id=1] [ext_resource path="res://src/mechanics/Black.png" type="Texture" id=1]
[ext_resource path="res://src/entities/behaviours/ErraticMovement.tscn" type="PackedScene" id=2] [ext_resource path="res://src/entities/behaviours/ErraticMovement.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/entities/behaviours/AttractedTo.tscn" type="PackedScene" id=3] [ext_resource path="res://src/entities/behaviours/AttractedTo.tscn" type="PackedScene" id=3]
[ext_resource path="res://src/entities/behaviours/Damageable.tscn" type="PackedScene" id=4] [ext_resource path="res://src/entities/behaviours/Damageable.tscn" type="PackedScene" id=4]
[ext_resource path="res://src/entities/behaviours/Alliance.tscn" type="PackedScene" id=5] [ext_resource path="res://src/entities/behaviours/Alliance.tscn" type="PackedScene" id=5]
[ext_resource path="res://src/entities/Enemy.gd" type="Script" id=6]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 16, 16 ) extents = Vector2( 16, 16 )
[node name="Enemy" type="KinematicBody2D"] [node name="Enemy" type="KinematicBody2D"]
collision_layer = 3 collision_layer = 3
script = ExtResource( 6 )
[node name="Shape" type="CollisionShape2D" parent="."] [node name="Shape" type="CollisionShape2D" parent="."]
shape = SubResource( 1 ) shape = SubResource( 1 )
@ -26,3 +28,5 @@ texture = ExtResource( 1 )
[node name="Alliance" parent="." instance=ExtResource( 5 )] [node name="Alliance" parent="." instance=ExtResource( 5 )]
alliance = -1 alliance = -1
[connection signal="dead" from="Damageable" to="." method="_on_Damageable_dead"]