Jump to content

Tiled


OttoRobba
 Share

Recommended Posts

I was fiddling with the Tiled plugin, trying to get it to work with object layers. I've managed to get the plugin not to crash with non-data layers and it properly finds the name of the object, along with its properties.

My question is, how can I create an entity from it?

 

For example: I created a class called "Troll" in my game. I created an object named "Troll" in Tiled.

My naïve approach was calling

new game[layer.objects[num].name]()

but that, clearly, didn't work. I've attached a sample project. The code that handles object initialization starts at line 84.

test-tiles.zip

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