Z Order on Side Scroller

Get help using Construct 2

Post » Thu Apr 17, 2014 9:04 pm

Hi Guys,

Im working on a 2d side scroller game. Im trying to make it somewhat 3D as the player can walk up and down, as well as side to side. I cant figure out how to manage the z order of all of the objects and enemies at run time. I want the the player to be in front of an enemy if his y position is greater than the enemies y, and i want all of the enemies to do the same thing with each other and the background objects. Is their a way to manage this that wouldn't crush the framerate? I tried using families and I just cant seem to get it to work. Thank you for any help!

Posts: 156
Reputation: 3,310

Post » Fri Apr 18, 2014 2:15 am

I've been wanting to do a similar "Double Dragon" style beat-em up style and run into the same problem. The only way I can think to reduce framerate issues is to use a combination of layers for static objects and the dynamic layering stuff only for objects that can change their Y (players and enemies usually). Generally both the background and "ground" can just be a flat image on the bottom layer.

If you find a better solution, please share it! :D
Posts: 17
Reputation: 1,484

Post » Fri Apr 18, 2014 8:31 am

Perhaps a Y position comparison for each object in combination with the "Move to Front/Behind" action will solve your problem.

See this example capx. It demonstrates a different issue (how can an enemy first come in line with the player and then start to move towards him/her) but it also follows the "Move to Front/Behind" principle (although somewhat limited in power).

composer - multimedia artist
Posts: 1,146
Reputation: 10,379

Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, gskunk, richcoz81, tarek2 and 44 guests