
import Phaser from "phaser";
import skyImage from '../../assets/sky.png';
import groundImage from '../../assets/ground.png';
import martyJumpImage from '../../assets/marty-jump.png';
import martyWaistImage from '../../assets/marty-waist.png';
import martyHurtImage from '../../assets/marty-hurt.png';
import cogImage from '../../assets/cog.png';
import starImage from '../../assets/star.png';
import shinyStarImage from '../../assets/star-shine.png';
import restartImage from '../../assets/restart.png';
import gameOverImage from '../../assets/game-over.png';
//@ts-ignore
import hitSound from '../../assets/hit.m4a';
//@ts-ignore
import progressSound from '../../assets/reach.m4a';
//@ts-ignore
import jumpSound from '../../assets/jump.m4a';

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

  preload() {
    this.load.image("sky", skyImage);
    this.load.image("ground", groundImage);

    this.load.image("marty-jump", martyJumpImage);
    this.load.image("marty-waist", martyWaistImage);
    this.load.image("marty-hurt", martyHurtImage);

    this.load.image("cog", cogImage);
    this.load.image("star", starImage);
    this.load.image("shiny-star", shinyStarImage);

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

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

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

}

export default PreloadScene;
