0 Favourites

Single Layout, Multiple Levels. Help w/Tilemaps

  • Hey guys. I'm creating a simple platformer and I figured, memory-wise using a single layout with multiple instances of the same tilemap might be the best solution for different levels. Is this a correct assumption?

    How do I save the tilemap configurations into an array and load them to the appropriate levels in the game?

    I'd appreciate it if someone could edit this capx. <img src="{SMILIES_PATH}/icon_cool.gif" alt="8-)" title="Cool">

    https://www.dropbox.com/s/ctwcooln67707 ... .capx?dl=0

    Haven't done much in the capx yet.

  • You can save a tile map configuration using the tilemap's 'TilesJSON' expression. You can store it as a string - if I need multiple tilemaps for multiple levels I'll usually use a Dictionary with keys named for each level, and the value set to the TilesJSON for that level.

  • You can save a tile map configuration using the tilemap's 'TilesJSON' expression. You can store it as a string - if I need multiple tilemaps for multiple levels I'll usually use a Dictionary with keys named for each level, and the value set to the TilesJSON for that level.

    Can you show example too of how to repopulate the map after?

    I made different instances of the tilemap but how do I use only one?

  • You can save a tile map configuration using the tilemap's 'TilesJSON' expression. You can store it as a string - if I need multiple tilemaps for multiple levels I'll usually use a Dictionary with keys named for each level, and the value set to the TilesJSON for that level.

    I found the download as json action but now how do I save multiple levels?

    I'm thinking have all maps in my MAIN MENU layout, save all tilemaps as json then delete all. So the next time a user starts the game the tilemaps will be deleted and accessed from webstorage.

    Is this the correct usage? Could someone modify the capx?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Personally I would create the tilemaps in C2, grab their JSONs one by one, then store them in a dictionary.json which you include as a project file and load on start - rather than writing events to populate the dictionary, which I think would mean you'd have to loop through the levels on start.

  • Personally I would create the tilemaps in C2, grab their JSONs one by one, then store them in a dictionary.json which you include as a project file and load on start - rather than writing events to populate the dictionary, which I think would mean you'd have to loop through the levels on start.

    Yes that's exactly what I mean't. Sorry my games haven't really been as complex to require the use of the dictionary that's why I'm confused.

    Using this dictionary, will it be saved locally when I export this game to Android/iOS or will users be required to download all info from a cloud?

  • If the JSON is stored as a project file and loaded on start, the file will be saved locally, yes.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
157 12,688
megatronx's avatar
megatronx
Unread hot topic
0 Favourites
Kiira will help! :D
132 16,604
Kiira's avatar
Kiira
Unread hot topic
132 29,584
chadorireborn's avatar
chadorireborn