extends Node2D

#var enemy_type: String = "mirror"
var tween_speed: float = 1.4
var start_pos = Vector2.ZERO

var exploding = false
var health: int = 3

@onready var screensize = get_viewport_rect().size
@onready var sink_player = $EnemyMirror/AnimationPlayer

func _ready() -> void:
  start_all_animations()


func start(pos):
  position = Vector2(pos.x, -pos.y)
  start_pos = pos
  var tween = create_tween().set_trans(Tween.TRANS_BACK)
  tween.tween_property(self, "position:y", start_pos.y, tween_speed)


func start_all_animations():
  for child in get_children():
    if child is AnimationPlayer:
      child.play("patrol")
