game: improve enemy-manager

This commit is contained in:
2025-08-21 06:11:09 +02:00
parent 83e2067fea
commit f0f717e00e
5 changed files with 63 additions and 4 deletions

View File

@@ -9,6 +9,7 @@ extends Node2D
@onready var active_cd_timer: Timer = $ActiveCDTimer
func _on_attack_cd_timer_timeout() -> void:
do_attack()
@@ -16,16 +17,18 @@ func _on_attack_cd_timer_timeout() -> void:
func do_attack() -> void:
push_error("%s does not implement do_attack" % self)
func do_active() -> void:
if not active_cd_timer.is_stopped():
return
active_cd_timer.start()
_do_active()
func _do_active() -> void:
push_error("%s does not implement do_active" % self)
func find_target_in_radius() -> EnemyBase:
var space_state: PhysicsDirectSpaceState2D = get_world_2d().direct_space_state
var shape := CircleShape2D.new()