Pseudo 3D Z layer help.

Get help using Construct 2

Post » Mon Jan 09, 2017 10:19 pm

When trying to make a game that uses pseudo 3D. The closest example I can come up with is the style Don't Starve uses, just a little less 3D. My idea involves the player character being in front or behind an object depending on their Y value and the objects Y value. However, the problem I have is that only the first object created works correctly, all the others are always in front of the player.

I need to know if I can improve my "3D" system to fix this issue. I've already tried "for each" and that's about all I can think of. Any help?
Oh, okay.
Posts: 41
Reputation: 1,405

Post » Tue Jan 10, 2017 2:17 am

Sort Z order
Sort the Z order of instances of a given object according to an instance variable. This effectively removes all instances from their Z order, sorts them, then inserts the sorted sequence back into the holes left behind. This means if the instances are spread across a range of layers, they will be sorted in the same Z order locations, maintaining the same order relative to other instances on those layers. Note this action is much faster than using an ordered For each with an action like Send to front/back, so this action should be the preferred way to sort the Z order of large numbers of instances.

There should be a bit more information on how to implement it if you do a forum search.
Image ImageImage
Posts: 8,628
Reputation: 124,532

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests