Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var A = {};
- A.Extends = Phaser.Scene;
- A.initialize = function () {
- Phaser.Scene.call(this, {key: "sceneA"});
- };
- A.init = function (data) {
- console.log("Scene A Init", data);
- };
- A.create = function () {
- console.log("Scene A");
- };
- var SceneA = new Phaser.Class(A);
- var Battle = {};
- Battle.Extends = Phaser.Scene;
- Battle.initialize = function () {
- Phaser.Scene.call(this, {key: "battle"});
- };
- Battle.create = function () {
- console.log("Battle Scene");
- this.scene.start("sceneA", {xsd:123, abc:321});
- };
- var BattleScene = new Phaser.Class(Battle);
- var config = {
- type: Phaser.AUTO,
- width: 800,
- height: 600,
- parent: 'game',
- scene: [ BattleScene, SceneA ]
- };
- var game = new Phaser.Game(config);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement