Nokdu Posted November 11, 2014 Share Posted November 11, 2014 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 More sharing options...
CtlAltDel Posted November 11, 2014 Share Posted November 11, 2014 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); } Link to comment Share on other sites More sharing options...
Nokdu Posted November 12, 2014 Author Share Posted November 12, 2014 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 More sharing options...
Recommended Posts