Hello
I’d like to pass a variable, which is a stage number and comes from React, to Phaser.Game.
Here is a scenario.
1.React displays stage buttons. Each buttons has stage data attribute.
2.When user clicks the button, React component runs this.game = new Phaser.Game(config)
3.In Preload method of Phaser.Scene, which is the first loaded, loads the stage data dynamically using scene.load.tilemapTiledJSON(“stage”, “./src/assets/maps/“passed variable”.json”);
I don’t know how to deal with #2.
Any advice is welcome.
Thanks