Jump to content

Using the TMX tilemap format for a simple adventure game script?


tyson
 Share

Recommended Posts

Hi all,  I'm looking to use the TMX tilemap format as a way to make a simple adventure game system.

 

I'm avoiding using any classic adventure game techniques to keep an easy workflow using traditional tile-based tools.

 

Does this sound workable for a 'Room Controller' ?

 

  • Make an Object in an object layer
  • Put variables with corresponding object names with sequential numbers at the end, with the required command as the parameter.
    or example - playerTalk1 : "Hi there I want to be a pirate!",  moveTo : (100, 100)
  • Parse each variable in the json/xml

 

Cheers,

 

--Tys

Link to comment
Share on other sites

  • 4 weeks later...

It may be a little late, but you can export your map as a JSON object. This means, it is perfectly made for JS.

 

- When you have your map exported, open it up in notepad

- This entire piece of text is an object, and it is written so you can use it as a variable!

 

This way you can acces all objects and layers and their classes with just one line of code!

/*map - your variable with the JSON content as valuelayers[0] - the first layerobjects[0] - the first object from that layer*/map.layers[0].objects[0].x
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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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