mirror of
https://github.com/RYGhub/the-cold-night.git
synced 2024-11-22 12:44:20 +00:00
🔧 Free enemy on death
This commit is contained in:
parent
431255dd13
commit
da81aa103e
2 changed files with 10 additions and 1 deletions
5
src/entities/Enemy.gd
Normal file
5
src/entities/Enemy.gd
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
extends KinematicBody2D
|
||||||
|
|
||||||
|
|
||||||
|
func _on_Damageable_dead():
|
||||||
|
queue_free()
|
|
@ -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"]
|
||||||
|
|
Loading…
Reference in a new issue