18 lines
397 B
GDScript
18 lines
397 B
GDScript
extends Area2D
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
await get_tree().physics_frame
|
|
for body in get_overlapping_bodies():
|
|
if body.is_in_group("enemies"):
|
|
body.hit()
|
|
await $AnimatedSprite2D.animation_finished
|
|
queue_free()
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
|