use enemy parent script
This commit is contained in:
parent
096ebe5aa4
commit
20fa885736
4 changed files with 23 additions and 23 deletions
|
@ -1,12 +1,4 @@
|
|||
extends Node2D
|
||||
extends "res://objects/enemy/enemy.gd"
|
||||
|
||||
export var can_be_killed_by_sword = true
|
||||
|
||||
func _on_Area2D_area_entered(area):
|
||||
#Kill player
|
||||
if area.is_in_group("player"):
|
||||
area.get_parent().die()
|
||||
#Die from sword
|
||||
if area.is_in_group("sword"):
|
||||
if can_be_killed_by_sword:
|
||||
queue_free()
|
||||
func _process(delta):
|
||||
scale.x = -1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue