Start a state from button in the DOM

I need to have a game load and boot but wait to have the game state started from a button in the DOM.

I had done this with Phaser 2 when the game is defined like:

var game;
(function() {
game = new Phaser.Game(640, 1138, Phaser.CANVAS, ‘kaiju-game’);
game.state.add(“Boot”,boot);
game.state.add(“TheGame”,theGame);
game.state.start(“Boot”);
})();

using this function:
function startgame(){
game.state.start(“TheGame”);
}

what would be the equivalent in Phaser 3 when the game is defined like:

export default new Phaser.Game({
type: Phaser.AUTO,
scene: [Boot, TheGame, GameStart],
});

Thanks for any help.

It should be something like this:

yourPhaserGameIntsance.scene.start("boot")

Your boot scene must be defined like this:

export default class Boot extends Phaser.Scene{
 
    constructor ( parent )
    {
        super({ 
            key: 'boot',
        });
    }

:slight_smile: this is how i handle my scene chances. maybe there are some other options…

Greetings.