AAAA
This commit is contained in:
parent
279b5e5599
commit
4f70414ed9
46 changed files with 1485 additions and 170 deletions
13
Objects/DeathCollider/DeathCollider.gd
Normal file
13
Objects/DeathCollider/DeathCollider.gd
Normal file
|
@ -0,0 +1,13 @@
|
|||
extends Area2D
|
||||
|
||||
var killing = null
|
||||
@export var detecting := false
|
||||
|
||||
func _on_body_shape_entered(body_rid, body, body_shape_index, local_shape_index):
|
||||
if "die" in body and detecting:
|
||||
killing = body
|
||||
|
||||
func _physics_process(delta):
|
||||
if killing:
|
||||
killing.die()
|
||||
killing = null
|
14
Objects/DeathCollider/DeathCollider.tscn
Normal file
14
Objects/DeathCollider/DeathCollider.tscn
Normal file
|
@ -0,0 +1,14 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://b5cr2rihwvwq2"]
|
||||
|
||||
[ext_resource type="Script" path="res://Objects/DeathCollider/DeathCollider.gd" id="1_get24"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pangl"]
|
||||
size = Vector2(16, 16)
|
||||
|
||||
[node name="DeathCollider" type="Area2D"]
|
||||
script = ExtResource("1_get24")
|
||||
|
||||
[node name="Collider" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_pangl")
|
||||
|
||||
[connection signal="body_shape_entered" from="." to="." method="_on_body_shape_entered"]
|
Loading…
Add table
Add a link
Reference in a new issue