Jump to content

Sprite sheet woes


Recommended Posts

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...