Jump to content

Atlas sprite body error


jbwilhite
 Share

Recommended Posts

Hi,

I am trying to replace a standard sprite sheet in my game with a json atlas, but I am getting error when I try to access the body element of the sprite. I couldn't find anything in the examples or on the forum about this.  The sprite works fine with a plain png spritesheet.

 

function preload() {

game.load.atlas( 'atlas', 'assets/player.png', 'assets/player.json' );

}

 

function create() {

player = game.add.sprite(32, 32, 'atlas');

player.body.collideWorldBounds = true; //error here

}

 

Thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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