Jump to content

tiled json problem


nak3ddogs
 Share

Recommended Posts

hi. i have a funny problem.

 

i use tiled program  for build up my map and always i got the same problem.

in the tiled i got the map correctly but in the game every tile got the next tilemap picture.

 

function preload() {
          // Load the 'map.json' file using the TILDED_JSON special flag
          game.load.tilemap('pina', 'assets/proba.json', null, Phaser.Tilemap.TILED_JSON);
          game.load.image('level', 'assets/tilemap.png');
 }
 

function create() {

          map = game.add.tilemap('pina');

          map.addTilesetImage('level');

          
          // Create a layer from the 'map.json' file
          // based on 'Tile Layer 1' from the available tiles.
          layer2 = map.createLayer('Tile Layer 2');
          layer1 = map.createLayer('Tile Layer 1');
          layer2.scrollFactorX = 0.5;
 
          layer1.resizeWorld();
}

 

sry for my english

thx for advice

post-9438-0-42005800-1404388330_thumb.pn

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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