extends Enemy

@onready var drone: AudioStreamPlayer2D = $drone

func _ready():
	super._ready()
	sm.add(Callable(), Callable(), Callable(), _chase_player_fixed_update)
	sm.start(_chase_player_fixed_update)
	fire_timer = randf_range(0.0, 1.0)
	play(drone)

func _process(delta: float) -> void:
	super._process(delta)
	# see if we are facing the player
	if can_fire && is_aim_ok(global_position):
		var b:Bolt = fire_bullet(global_position, -transform.y )
		if b:
			b.detector.collision_mask = ~C.LYR_MASK_ENEMY
