Adds enemies
This commit is contained in:
parent
cf8ba8bacb
commit
76e5b1927f
324 changed files with 28447 additions and 106 deletions
22
demo/agents/scripts/hurtbox.gd
Normal file
22
demo/agents/scripts/hurtbox.gd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#*
|
||||
#* hurtbox.gd
|
||||
#* =============================================================================
|
||||
#* Copyright (c) 2023-present Serhii Snitsaruk and the LimboAI contributors.
|
||||
#*
|
||||
#* Use of this source code is governed by an MIT-style
|
||||
#* license that can be found in the LICENSE file or at
|
||||
#* https://opensource.org/licenses/MIT.
|
||||
#* =============================================================================
|
||||
#*
|
||||
class_name Hurtbox
|
||||
extends Area2D
|
||||
## Area that registers damage.
|
||||
|
||||
@export var health: Health
|
||||
|
||||
var last_attack_vector: Vector2
|
||||
|
||||
|
||||
func take_damage(amount: float, knockback: Vector2, source: Hitbox) -> void:
|
||||
last_attack_vector = owner.global_position - source.owner.global_position
|
||||
health.take_damage(amount, knockback)
|
||||
Loading…
Add table
Add a link
Reference in a new issue