package game.locations.elevatorHall;

import base.GameSprite;
class ElevatorDoors extends GameSprite {
  var leftDoor: GameSprite;
  var rightDoor: GameSprite;

  public function new() {
    super();

    leftDoor = new GameSprite('assets/locations/elevatorHall/left_door.png');
    rightDoor = new GameSprite('assets/locations/elevatorHall/right_door.png');

    leftDoor.x = -leftDoor.width;

    addChild(leftDoor);
    addChild(rightDoor);
  }

  public function open(?callback: Void -> Void = null) {
    leftDoor.tween({ x: -leftDoor.width * 2 }, 1.75);
    rightDoor.tween({ x: rightDoor.width }, 1.70).then(callback);

    Game.currentGame.playSound('sound/elevator/doors_open.ogg');
  }
}
