@@ -8,16 +8,12 @@ class SpringrollGame {
88 constructor ( ) {
99 // Instance of a Springroll.Application.
1010 // Flag any additional features. See https://github.com/SpringRoll/SpringRoll/tree/master/src
11- this . application = new Application ( {
12- features : {
13- sfx : true
14- }
11+ this . application = new Application ( {
12+ features : {
13+ sfx : true
14+ }
1515 } ) ;
1616
17- // Instance of a Springroll.SafeScaleManager.
18- // This will be initialized after the Phaser.Game is ready.
19- this . safeScale = undefined ;
20-
2117 // Instance of a Phaser.Game.
2218 // This will be initialized when the application is ready.
2319 this . game = undefined ;
@@ -40,7 +36,7 @@ class SpringrollGame {
4036 this . application . state . captionsMuted . subscribe ( result => {
4137 console . log ( 'captionsMuted: ' , result ) ;
4238 } ) ;
43-
39+
4440 // Create a Phaser.Game.
4541 this . game = new Phaser . Game ( {
4642 type : Phaser . AUTO ,
@@ -51,20 +47,17 @@ class SpringrollGame {
5147 plugins : {
5248 // FactoryPlugin is not necessary for Springroll, however it demonstrates
5349 // how to setup and install a Phaser.Plugin.
54- global : [ { key : "FactoryPlugin" , plugin : FactoryPlugin , start : true } ]
50+ global : [ { key : "FactoryPlugin" , plugin : FactoryPlugin , start : true } ]
5551 }
5652 } ) ;
5753
58- // Listen for when the game is ready.
59- this . game . events . once ( "ready" , ( ) => {
60- // Create a Springroll.SafeScaleManager.
61- this . safeScale = new SafeScaleManager ( {
62- width : GAMEPLAY . WIDTH ,
63- height : GAMEPLAY . HEIGHT ,
64- safeWidth : GAMEPLAY . SAFE_WIDTH ,
65- safeHeight : GAMEPLAY . SAFE_HEIGHT ,
66- callback : this . onWindowResize . bind ( this )
67- } ) ;
54+ // Create a Springroll.SafeScaleManager.
55+ this . safeScale = new SafeScaleManager ( {
56+ width : GAMEPLAY . WIDTH ,
57+ height : GAMEPLAY . HEIGHT ,
58+ safeWidth : GAMEPLAY . SAFE_WIDTH ,
59+ safeHeight : GAMEPLAY . SAFE_HEIGHT ,
60+ callback : this . onWindowResize . bind ( this )
6861 } ) ;
6962
7063 // Add game scenes.
@@ -74,7 +67,7 @@ class SpringrollGame {
7467 }
7568
7669 onApplicationPause ( value ) {
77- if ( value ) {
70+ if ( value ) {
7871 this . game . scene . pause ( SCENE . GAME ) ;
7972 }
8073 else {
0 commit comments