var config = {
type: Phaser.AUTO,
width: 1136, height: 640, parent: ‘gameholder’,
scene:{
physics: {
arcade: { gravity: { y: 60 } },
matter: { debug: true, gravity: { y: 0.5 } }
}
}
};
var game = new Phaser.Game(config);
var main = new Main();
var gravityGame1 = new GravityGame1();
var gravityGame2 = new GravityGame2();
game.scene.add('main ', main );
this.game.scene.add('gravityGame1 ', gravityGame1 );
this.game.scene.add('gravityGame2 ', gravityGame2 );
NOTE: You will no longer need a constructor in your scene classes. When you want to go to a scene, you will reference it by the first parameter in this.game.scene.add('gravityGame1 ', gravityGame1 );