Coins system, and finished mortar
This commit is contained in:
@ -12,6 +12,8 @@ var midpoint = 0
|
||||
var t = 0.0
|
||||
var duration = 0.5
|
||||
|
||||
static var NAMES = ["Forkman", "Cobold", "Ork"]
|
||||
|
||||
func _ready() -> void:
|
||||
starterpos = global_position
|
||||
targetpos = target.global_position
|
||||
@ -34,6 +36,12 @@ func _process(delta: float) -> void:
|
||||
position = bezier(t)
|
||||
if t >= 1.0:
|
||||
get_node("CharacterBody2D/AnimatedSprite2D").play("hit")
|
||||
var killalll = get_node("Area2D").get_overlapping_bodies()
|
||||
for i in killalll:
|
||||
for j in NAMES:
|
||||
if i.get_parent().name.contains(j):
|
||||
i.get_parent().enemy_hurt(hitpoint)
|
||||
|
||||
set_process(false)
|
||||
elif target and speed > 0:
|
||||
# Get the direction vector from the bullet to the target
|
||||
|
Reference in New Issue
Block a user