Reading custom properties

Apr 27, 2011 at 2:13 AM

Hi, I'm using the map of the example that appears in the web for the project that I'm making, and I want to know how could be the code in order to my project could read the custom properties of the map, and of a special tile.
And I'm developing of the collisions between the character and the tiles, I would also like to know if it's possible that step or passing a tile with my character would trigger an event or something like that.
Thanks for the attention, I found very useful the program.

Apr 27, 2011 at 10:16 AM

Regarding reading custom properties, have a look at this discussion:

As for collision detection, have a look at this:

Apr 30, 2011 at 3:21 AM
Edited Apr 30, 2011 at 3:21 AM

Thanks, I checked some topics, but I didn't see them. But now I have another problem, using the method of collision that you explain here:

I would like how it's possible to detect the collisions with my characters on the 4 sides of the tile. Because I have to use a rectangle with my character and I don't know if the map takes it like a rectangle or point.

Thanks for the links and your attention, sorry for the problems.

May 1, 2011 at 4:12 PM

There are many ways to handle collisions against the 4 sides of a solid block. One simple way is to keep track of not just the current tile the player is on, but also the tile from the previous loop. That way, if the current tile is a solid block and the previous tile was, say, to the left and was an empty tile, you would simply move the player back to the left tile. You can apply similar logic for the cases when the previous tile was to the right, above or below to implement collisions against walls, floors and ceilings.