Jump to content

error while loading atlasJSONArray


az00000
 Share

Recommended Posts

Hello guys

 

i have this code 

var game = new Phaser.Game(	900, 900, Phaser.AUTH, '',	{		preload: preload,		create: create,		update: update	});var map,	ground,	trees,	player;function preload() {	game.world.setBounds(0,0,1280, 600);	game.load.tilemap(		'world',		'assets/javascripts/world.json',		null,		Phaser.Tilemap.TILED_JSON	);	game.load.image('worldtile', 'assets/images/RPG_Maker_VX_RTP_Tileset_by_telles0808.png');	game.load.atlasJSONArray('player', 'assets/images/player.png', 'assets/javascripts/player.json');}function create() {		map = game.add.tilemap('world');	map.addTilesetImage('RPG_Maker_VX_RTP_Tileset_by_telles0808', 'worldtile');	ground = map.createLayer('ground');	trees = map.createLayer('trees');		player = game.add.sprite(300, 200, 'player');	game.physics.arcade.enable(player);		player.animations.add('down', [0, 1, 2], 15, true, false);	player.animations.add('left', Phaser.Animation.generateFrameNames('player-left-', 1, 2, '.png'), 15, true, false);	game.camera.follow(player);}function update() {	if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN))  {		player.body.velocity.y = 40;		//player.animations.stop('walk_left');		player.animations.play('down', 5, true);  } else if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {	  player.body.velocity.x = -40;	  //player.animations.stop('walk_down');	  //player.animations.play('left', 5, true);	} else {		player.animations.stop();		player.body.velocity.x = 0;		player.body.velocity.y = 0;	}}

the tilemap works great but i cant see the player and i get this error:

Uncaught TypeError: Cannot read property 'uuid' of undefined

any help !

post-13408-0-64738400-1425330738.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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