For your enemy
add Area2d
node and then add CollisionShape2D
to Area2D
and set a shape of your choice.
Area2D
can detect object entered its area.
For your player
use KinematicBody2D
and set its shape.
Then add your player to group
player
image
Now go to your enemy scene, select Area2D
node and connect signal body_entered(body : Node)
image
Then use this code
#this function is called when any body enters this area
func _on_Area2D_body_entered(body):
#confirm that the body is player
if body.is_in_group("player"):
#call kill , assuming that you have defined kill function for player
body.kill()