"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _gamepaused = _interopRequireDefault(require("../../assets/gamepaused.png"));
var _player = _interopRequireDefault(require("../../assets/player.png"));
var _martyLeft = _interopRequireDefault(require("../../assets/marty-left.png"));
var _martyRight = _interopRequireDefault(require("../../assets/marty-right.png"));
var _martyUp = _interopRequireDefault(require("../../assets/marty-up.png"));
var _martyDown = _interopRequireDefault(require("../../assets/marty-down.png"));
var _star = _interopRequireDefault(require("../../assets/star.png"));
var _tiles = _interopRequireDefault(require("../../assets/tiles.png"));
var _map = _interopRequireDefault(require("../../assets/map0.json"));
var _map2 = _interopRequireDefault(require("../../assets/map1.json"));
var _map3 = _interopRequireDefault(require("../../assets/map2.json"));
var _map4 = _interopRequireDefault(require("../../assets/map3.json"));
var _map5 = _interopRequireDefault(require("../../assets/map4.json"));
var _map6 = _interopRequireDefault(require("../../assets/map5.json"));
var _map7 = _interopRequireDefault(require("../../assets/map6.json"));
var _map8 = _interopRequireDefault(require("../../assets/map7.json"));
var _map9 = _interopRequireDefault(require("../../assets/map8.json"));
var _map10 = _interopRequireDefault(require("../../assets/map9.json"));
var _map11 = _interopRequireDefault(require("../../assets/map10.json"));
var _map12 = _interopRequireDefault(require("../../assets/map11.json"));
var _map13 = _interopRequireDefault(require("../../assets/map12.json"));
var _map14 = _interopRequireDefault(require("../../assets/map13.json"));
var _map15 = _interopRequireDefault(require("../../assets/map14.json"));
var _map16 = _interopRequireDefault(require("../../assets/map15.json"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const maps = [_map.default, _map2.default, _map3.default, _map4.default, _map5.default, _map6.default, _map7.default, _map8.default, _map9.default, _map10.default, _map11.default, _map12.default, _map13.default, _map14.default, _map15.default, _map16.default];
class Preloader extends Phaser.Scene {
  constructor() {
    super({
      key: 'preloader'
    });
  }
  preload() {
    // just a preload bar in graphics
    let progress = this.add.graphics();
    this.load.on('progress', value => {
      progress.clear();
      progress.fillStyle(0x73c494, 1);
      progress.fillRect(0, +this.sys.game.config.height / 2 - 30, +this.sys.game.config.width * value, 60);
    });
    this.load.on('complete', () => {
      progress.destroy();
    });

    // Load assets here
    // ...
    this.load.image('tiles', _tiles.default);
    for (let m = 0; m < 16; m++) {
      this.load.tilemapTiledJSON('map' + m, maps[m]);
    }
    this.load.spritesheet('player', _player.default, {
      frameWidth: 32,
      frameHeight: 32
    });
    this.load.image('marty-left', _martyLeft.default);
    this.load.image('marty-right', _martyRight.default);
    this.load.image('marty-up', _martyUp.default);
    this.load.image('marty-down', _martyDown.default);
    this.load.image('star', _star.default);
    this.load.image('gamepaused', _gamepaused.default);
  }
  create() {
    this.scene.start(this.startPosition.startScene);
  }
}
var _default = exports.default = Preloader;