
import Phaser from "phaser";
import skyImage from '../../assets/sky.png';
import groundImage from '../../assets/ground.png';
import martyInPlane from '../../assets/marty-in-plane.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';
import playImage from '../../assets/playbutton.svg';
import hitSoundOgg from '../../assets/hit.ogg';
import hitSoundM4a from '../../assets/hit.m4a';
import progressSoundOgg from '../../assets/reach.ogg';
import progressSoundM4a from '../../assets/reach.m4a';
import jumpSoundOgg from '../../assets/jump.ogg';
import jumpSoundM4a 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-in-plane", martyInPlane);
    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.image("play", playImage);

    this.load.audio("jump", [jumpSoundOgg, jumpSoundM4a]);
    this.load.audio("hit", [hitSoundOgg, hitSoundM4a]);
    this.load.audio("progress", [progressSoundOgg, progressSoundM4a]);
  }

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

}

export default PreloadScene;
