
import Phaser from "phaser";
import mountainImage from '../../assets/mountain.png';
import martySkiLeftImage from '../../assets/marty-ski-left.png';
import martySkiRightImage from '../../assets/marty-ski-right.png';
import martySkiStraightImage from '../../assets/marty-ski-straight.png';
import martyHurtImage from '../../assets/marty-ski-hurt.png';
import treeImage from '../../assets/tree.png';
import restartImage from '../../assets/restart.png';
import gameOverImage from '../../assets/game-over.png';
import playImage from '../../assets/playbutton.svg';
import stopImage from '../../assets/stopbutton.svg';
//@ts-ignore
import hitSound from '../../assets/hit.m4a';
//@ts-ignore
import progressSound from '../../assets/reach.m4a';

import flagsImage from '../../assets/flags.png';

class PreloadScene extends Phaser.Scene {
  constructor() {
    super("PreloadScene");
  }

  preload() {
    this.load.image("mountain", mountainImage);

    this.load.image("marty-ski-left", martySkiLeftImage);
    this.load.image("marty-ski-right", martySkiRightImage);
    this.load.image("marty-ski-straight", martySkiStraightImage);
    this.load.image("marty-ski-hurt", martyHurtImage);

    this.load.image("flags", flagsImage);
    this.load.image("tree", treeImage);

    this.load.image("restart", restartImage);
    this.load.image("game-over", gameOverImage);

    this.load.image("play", playImage);
    this.load.image("stop", stopImage);

    this.load.audio("hit", hitSound);
    this.load.audio("progress", progressSound);
  }

  create() {
    this.scene.start("PlayScene");
  }

}

export default PreloadScene;
