Linzeestomp Posted June 21, 2018 Share Posted June 21, 2018 Just toying around in Phaser 3 tonight and I got this to render totally fine without breaking any kind of scopes. sceneName = new Phaser.Scene({ key: 'sceneName', active: true, visible: true, }); /** * sceneA functions */ sceneName.preload = function () { /** * Preload things here */ console.log('Preloading scene...'); this.load.image('logo', 'assets/logo.png'); sceneName.create = function () { /** * Create things here */ console.log(this.sys.settings.key, 'is alive and fine!'); this.add.image(400, 300, 'logo'); sceneName.update = function () { /** * Update things here * * CAREFUL: TOO MUCH CODE HERE = LAG! */ console.log("Looping!"); } }; }; I was a little surprised this worked without anything breaking--can anyone tell me if there is any inherent benefit of structuring my scenes like this ? Link to comment Share on other sites More sharing options...
Recommended Posts