Jump to content

feeding data into tilemaps


Recommended Posts



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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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