alteredMethod Posted January 30, 2014 Share Posted January 30, 2014 Hello, I downloaded a copy of phaser and threw it in my MAMP folder - started my local web server. And then created a basic game.html file + game.js + phaser.js. game.html looks like this: <html> <head> <script src="phaser.js"></script> <script src="game.js"></script> </head> <body> <div id="game"></div> </body></html> game.js looks like this: var headImage;var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });function preload() { game.load.image('head', 'head.png');}function create() {}function update() {}I opened in chrome, and am seeing a blank page with the following error in the console: "Uncaught TypeError: Cannot read property 'style' of null" I'm not sure what I'm doing wrong. Link to comment Share on other sites More sharing options...
rich Posted January 31, 2014 Share Posted January 31, 2014 Your div ID is 'game' but you're telling it to insert into 'phaser-example'. Change them to match Link to comment Share on other sites More sharing options...
jerome Posted January 31, 2014 Share Posted January 31, 2014 game creation in deep : https://github.com/photonstorm/phaser/wiki/Phaser-General-Documentation-:-Game Link to comment Share on other sites More sharing options...
Recommended Posts