Posts: 673
Threads: 33
Joined: Jan 1970
Reputation:
13
Hi,
How you're doing with actors and game objects? Any progress?
Posts: 187
Threads: 22
Joined: Dec 2020
Reputation:
1
I don't know how I can put the data in the Tilengine's Object List into the language's list
Posts: 187
Threads: 22
Joined: Dec 2020
Reputation:
1
It iterates to the next item automatically? I thought I had to use a for loop to iterate through the list with a for loop by increasing the index variable (the common way to iterate through a list)
Also, can I define data such as the number of hp, the loot that the ennemy drops when killed, ... in Tiled?
Posts: 187
Threads: 22
Joined: Dec 2020
Reputation:
1
I usually use a
for(int c = 0; c < array.length - 1; c++)
{
// code
}
And if I understand well, my object has to possess the same attributes as the ObjectInfo structure
also, what is the Object Type for? I checked the Python TMX exemple, the type field is empty
Posts: 673
Threads: 33
Joined: Jan 1970
Reputation:
13
Yes, your created object should have the same attributes as the TLN_ObjectInfo structure, or at least the attributes you're interested on keeping.
The type property holds the type custom attribute you define in Tiled. You can't see it in Python Platformer example because when I did that project, I hadn't implemented yet in Tilengine, so the binding doesn't have this functionality. This example uses the gid (graphic identifier) of the object's tileset being used for each enemy type. However, a custom type property is more flexible than using directly the gid attribute.
Posts: 187
Threads: 22
Joined: Dec 2020
Reputation:
1
and if I understand well, I can use the type for object's speed or what the object loots for exemple?
Posts: 673
Threads: 33
Joined: Jan 1970
Reputation:
13
Yes, the actual value of type custom attribute is entirely upo to you, the game designer, to mean anything you decide. Tilengine will just tell you what value have you put in that property, but won't use it for anything.