game: improve enemy-manager
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user