class Game extends Phaser.Scene {
    constructor(game) {
        super('Game');
        this.game = game;
    }

    preload() {
        this.gm = new GamingBoard();
        this.game.scene.add('GamingBoard',this.gm);
    }

    create() {
        //this.add.image(0,0,'background').alpha = 0.1;

        let btn = this.add.sprite(WIDTH_WINDOW / 1.5, (HEIGHT_WINDOW / 3) * 2, 'btn_play').setOrigin(0.5, 0.5).setInteractive();
        //btn.setFrame(0);
        btn.on('pointerout', () => btn.setFrame(0));
        btn.on('pointerover', () => btn.setFrame(1));
        btn.on('pointerdown', () => this.clickPlay(btn));
        this.scene.launch('GamingBoard');
        this.scene.pause('GamingBoard');
    }

    clickPlay(btn){
        if(this.scene.isPaused('GamingBoard'))
            this.scene.resume('GamingBoard');
        else
            this.scene.pause('GamingBoard');
    }
}