Jump to content

problem with sprite animation


Luiz Bills
 Share

Recommended Posts

This is my code...

function preload() {    game.load.tilemap('level1', 'assets/rpgtiles.png', 'assets/rpg.json', null, Phaser.Tilemap.JSON);    game.load.spritesheet('sprites', 'assets/rpgtiles.png', 32, 32, -1);    // loaded assets without errors}var map,    player;function create() {    game.stage.backgroundColor = '#8888ff';    map = game.add.tilemap(0, 0, 'level1');    player = game.add.sprite(0, 0, 'sprites', 72);    player.body.collideWorldBounds = true;    player.animations.add('down', [72, 73], 10, true); // Uncaught TypeError: Cannot read property 'uuid' of null }

the spritesheet: https://docs.google.com/file/d/0B1W35LiKlq11WEV6QTNzbmd4Ylk/edit?usp=sharing

Link to comment
Share on other sites

  • 2 years later...

Thanks for this, i was going crazy about uncaught error and the reason was i was not defining max frames.

 

game.load.spritesheet('sprites', 'assets/rpgtiles.png', 32, 32, -1);

Change the -1 to the max number of frames in your spritesheet.  Right now you have -1 max frames.   ;)

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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