brentstrandy Posted June 19, 2018 Share Posted June 19, 2018 I'm trying to seed my game with custom data. For example, in Phaser 2 I was able to instantiate a new Game object with any number of parameters. It seems Phaser 3 is only looking for a config object with specific properties and nothing more. Is there a way to do this? new Phaser.Game({ type: Phaser.AUTO, width: 916, height: 400, scene: [BootScene, PreloaderScene, MenuScene, GameScene], antialias: true, myCustomObject: { } }); Note the "myCustomObject" passed into the game. I would prefer to keep my Phaser implementation to one line and not have to resort to the following: var myGame = Phaser.Game(config); myGame.scene.start('myScene', myCustomObject); Link to comment Share on other sites More sharing options...
brentstrandy Posted July 11, 2018 Author Share Posted July 11, 2018 Is there a chance someone knows what to do here? Link to comment Share on other sites More sharing options...
samme Posted July 11, 2018 Share Posted July 11, 2018 I think it would have to be { callbacks: { preBoot: function (game) { game.registry.merge(myCustomObject); } } } You could make a feature request. Maybe a game config key like data that could pass through arbitrary data. Link to comment Share on other sites More sharing options...
joephuz Posted September 4, 2019 Share Posted September 4, 2019 i was able to set a new var on the game object: let game = new Phaser.Game(config); game.test = 10202; export default game; Link to comment Share on other sites More sharing options...
Recommended Posts