FOE
This commit is contained in:
parent
bef6ae8f4e
commit
014d8af7d6
@ -24,6 +24,14 @@ extends CharacterBody2D
|
|||||||
@onready var atk2l: Node = get_node("AttackArea/Attack2CollisionL")
|
@onready var atk2l: Node = get_node("AttackArea/Attack2CollisionL")
|
||||||
@onready var atk2r: Node = get_node("AttackArea/Attack2CollisionR")
|
@onready var atk2r: Node = get_node("AttackArea/Attack2CollisionR")
|
||||||
|
|
||||||
|
@onready var list: Array = []
|
||||||
|
|
||||||
|
func add_foe(foe):
|
||||||
|
list.append(foe)
|
||||||
|
|
||||||
|
func remove_foe(foe):
|
||||||
|
list.erase(foe)
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
@ -39,7 +47,7 @@ func _process(delta):
|
|||||||
is_facing_left = velocity.x >= 0
|
is_facing_left = velocity.x >= 0
|
||||||
|
|
||||||
# AI STUFF
|
# AI STUFF
|
||||||
#velocity = processAI(objects,velocity,delta)
|
velocity = processAI(list,delta)
|
||||||
|
|
||||||
if !hitanim.is_emitting():
|
if !hitanim.is_emitting():
|
||||||
anim.modulate(Color(0,0,0,1))
|
anim.modulate(Color(0,0,0,1))
|
||||||
@ -104,7 +112,6 @@ func receive_exp(x):
|
|||||||
setLevel(level + 1)
|
setLevel(level + 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func setLevel(lvl):
|
func setLevel(lvl):
|
||||||
level = lvl
|
level = lvl
|
||||||
lvlanim.restart()
|
lvlanim.restart()
|
||||||
@ -124,7 +131,6 @@ func _on_sprite_animation_looped():
|
|||||||
is_dying = false
|
is_dying = false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_attack_area_body_entered(body):
|
func _on_attack_area_body_entered(body):
|
||||||
if typeof(body) == typeof(TemplateSpawnable):
|
if typeof(body) == typeof(TemplateSpawnable):
|
||||||
body.receive_damage(damage)
|
body.receive_damage(damage)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user