Hi!
I finished writing my first Phaser game and it’s running fine… in Chrome!
I just tried it in Safari and everything I get is a white screen. In the console I don’t see any error message.
This is my main game.js code:
import SceneInit from './SceneInit.js';
import SceneNewGame from './SceneNewGame.js';
import SceneHelp from './SceneHelp.js';
import SceneLevels from './SceneLevels.js';
import SceneClassroom from './SceneClassroom.js';
import ScenePlay from './ScenePlay.js';
import SceneMenu from './SceneMenu.js';
import SceneQuiz from './SceneQuiz.js';
import SceneMathTest from './SceneMathTest.js';
import SceneCongratulations from './SceneCongratulations.js';
// Our game scene
var sceneInit = new SceneInit();
var sceneNewGame = new SceneNewGame();
var sceneHelp = new SceneHelp();
var sceneLevels = new SceneLevels();
var sceneClassroom = new SceneClassroom();
var scenePlay = new ScenePlay();
var sceneMenu = new SceneMenu();
var sceneQuiz = new SceneQuiz();
var sceneMathTest = new SceneMathTest();
var sceneCongratulations = new SceneCongratulations();
var config = {
type: Phaser.AUTO,
width: 1024,
height: 768,
backgroundColor: 0xff6600,
physics: {
default: "arcade",
arcade: {
gravity:{y:0},
debug: false,
}
},
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_HORIZONTALLY,
width: 1024,
height: 768
},
};
game = new Phaser.Game(config);
// load scenes
game.scene.add('sceneInit', sceneInit);
game.scene.add('sceneNewGame', sceneNewGame);
game.scene.add('sceneHelp', sceneHelp);
game.scene.add('sceneLevels', sceneLevels);
game.scene.add('sceneClassroom', sceneClassroom);
game.scene.add('scenePlay', scenePlay);
game.scene.add('sceneMenu', sceneMenu);
game.scene.add('sceneQuiz', sceneQuiz);
game.scene.add('sceneMathTest', sceneMathTest);
game.scene.add('sceneCongratulations', sceneCongratulations);
RetrieveCookies();
// start title
game.scene.start('sceneInit');
I tried changing from AUTO to CANVAS and WebGL and got no changes.
After some tests I suspect that it is loading all the JS files but is not running game.JS. I put the following line at the end of the game.JS:
console.log('foo');
However it didn’t display anything in the Safari console window.
Ideas?