Jump to content

Collide with and pass behind the same building


Dlost1
 Share

Recommended Posts

Hello!

Just looking for some advice: I am building a 2D-adventure game. I want my char collide with a building when walking up from below or from the side (partly) I want my char to walk behind to higher part of a building (the rooftop).

So I was thinking to approach this by splitting the building into 2 objects: the lower part of the building and the roof. Than I might place the lower part in a object collision layer and the upper part in a "behind" layer. 

Now, I am wondering; is this the way to do it? Or is this a noobish approach? --> If so, how should I do it?  --> I am using Tiled//Phaser btw;)

Would love to hear your idea's! 

Link to comment
Share on other sites

I'd suggest using a single, invisible collision layer (doesn't even need to be rendered), then layering your visible artwork separately.

Then, use a foreground layer for tiles that the character has to be behind, such as the roof of the building, and a background layer for everything else.

This way, your collision information is separated from your artwork, giving you a little more freedom at the expense of another layer of data.

Just my suggestion though.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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