Jump to content

feeding data into tilemaps


Nokdu
 Share

Recommended Posts

Hi.

 

I was thinking about procedurally creating a dungeon like game..  and was thinking about using tilemaps.

 

is there anyway i can access the raw index of the tiles?

 

for example..

 

if i do

 

var atilemap = game.add.tilemaps();

 

is there a way i can do something like..

 

atilemap.data[j] = 0;

 

any help would be appreciated.

 

thank you

Link to comment
Share on other sites

      var map = game.add.tilemap();        map.addTilesetImage('tileimage');        var layer1 = map.create('level1', 40, 30, 32, 32);        var y = 19;        for (var x=10;x<30;x++) {            map.putTile(0,x, y, layer1);        }

Oh.. ok.. guess that will work.. 

 

although i was thinking about something like

 

var s = /* some long map data in csv or a javascript object*/

map.feeddata(s, layer1);

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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