tester Posted February 23, 2015 Share Posted February 23, 2015 I've a local webserver running and have successfully executed hello World I've tried using the SpriteSet example code like so:<!doctype html><html> <head> <meta charset="UTF-8" /> <title>hello xxxx!</title> <script src="phaser.min.js"></script> </head> <body> <script type="text/javascript"> var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create }); function preload() { game.load.spritesheet('mummy', 'ko2keeper.png', 64, 64, 18); } function create() { var mummy = game.add.sprite(300, 200, 'mummy'); mummy.animations.add('walk'); mummy.animations.play('walk', 20, true); } </script> </body></html>and Chrome complains phaser.min.js:7 Uncaught TypeError: Cannot read property 'style' of null The phaser lib loads fine. Any idea what is happening here ?Thanks in advance. Link to comment Share on other sites More sharing options...
rich Posted February 24, 2015 Share Posted February 24, 2015 'phaser-example' is the id of a div that exists in your page. Except it doesn't exist in yours Add:<div id="phaser-example"></div>Above your game code. Or just set 'phaser-example' to ''. Link to comment Share on other sites More sharing options...
Recommended Posts