import {Pad} from "../input/Pad";
export class GameOver extends Phaser.State {
    music: Phaser.Sound;

    preload() {
        this.game.load.image('gameover_bg', 'assets/images/gameover_bg.png');
        this.game.load.audio('end_music', 'assets/music/end.ogg');
    }

    create(){
        this.game.stage.backgroundColor = '#201d1d';
        this.game.add.sprite(0, 0, 'gameover_bg');

        this.music = this.game.add.audio('ritual_music');
        this.music.play();

        // setup controls
        this.game.input.gamepad.start();

        var pad = new Pad(this.game.input.gamepad.pad1);
        pad.onThree = ()=>{
            window.location.reload();
        };
    }

    shutdown(){
        this.music.stop();
    }
}