Simeon Posted February 1, 2015 Share Posted February 1, 2015 Hey Guys, I am a prospective game developer learning to make HTML5 games with Phaser. To do this, I am following a tutorial right now. Right now, my code isn't seem to be working properly. I have set up my Main.js file to just show an empty blue screen, like this:But for some reason, I get a black screen instead. I have set the background color to the hexadecimal code for blue. So if possible, please help me solve this problem, and be sure to give me some advice on Phaser. Thank You - Simeon Main.js code: // We create our only state, called 'mainState'var mainState = { // We define the 3 default Phaser functions preload: function() { // This function will be executed at the beginning // That's where we load the game's assets }, create: function() { // Change the background color of the game game.stage.backgroundColor = '#3498db'; // Tell Phaser what type of Physics we will be using game.physics.startSystem(Phaser.Physics.ARCADE); }, update: function() { // This function is called 60 times per second // It contains the game's logic }, // And here we will later add some of our own functions};// Create a 500px by 340 px game in the "gamediv" element on index.htmlvar game = new Phaser.Game(500, 340, Phaser.AUTO, 'gamediv');// Add the mainstate to Phaser and make it the main game.state.add('main', mainState);game.start.state('main');first game.zip Link to comment Share on other sites More sharing options...
Simeon Posted February 6, 2015 Author Share Posted February 6, 2015 If possible. Please help me. Link to comment Share on other sites More sharing options...
Recommended Posts