Depth Sorting w/ TileMaps


(Jayden Beveridge) #1

Hello everybody! Feeds good to finally have a forum back! So I’m having some problems. I’m using Ogmo to create levels and import them with it’s .xml like thing as thats all fine and dandy. My problem is I’m trying to give each tile a ‘depth’ tag, so I can make my player entity appear infront or behind the tiles (kinda like an oblique top-down view). Any help?


(Kevin Graham) #2

That’s a good question, and I am not entirely sure. If you were using entities I would suggest that you use a tag like isBellow that corresponds to a Boolean in your object that sets the layer depending on if it was true or not. I’m looking into it more now in Ogmo, hopefully I will have a better answer in a bit.


(Justin Wolf) #3

I don’t know if it’s possible to use separate layers on the same tilemap once it’s created in FlashPunk. The way I’m doing it - and probably not the best way - is just having a couple tilemaps on different layers. One for backgrounds, one for solids, etc.


(Kevin Graham) #4

Ya, I think this is the only way. I’ve seen this method used in several different FP games. :smiley:


(Alex Larioza) #5

@JaydenB Do you need the tiles’ depth to change during run-time or only set when designing the level? If its the latter, I recommend setting up different tile layers in Ogmo that correspond to the depths you want in game. Then when you load the tilemaps, set their entity layer to your desired depth.


(christopf) #6

When i understood you right, you recommendation is for the leveldesign. What would you recommend for a change during run-time?


(christopf) #7

Shall i make another topic for this or is my question here better preserved? I’m not so familiar with your forum habits yet and dont want to flood everything with my missing experience :confused:

to the topic (or the question of run.-time layer changes) I was thinking, this should be made easy if each entitys layer is oriented at their y value. like this

entitiesName.layer = -entitiesName.y

but this aint working. maybe there is a workaround?


(Jacob Albano) #8

Please do make another topic. In general it’s a good idea not to tag onto an existing topic unless you have a solution or an identical problem. Don’t worry about your lack of experience; it’s all part of the process. :smile: