Multiple units overlapping in isometric game.

Get help using Construct 2

Post » Tue Feb 04, 2014 7:04 am

Okay, so the game has multiple people on screen at once, and I need them to be in front or behind depending on where they are. Naturally, the higher it is on screen, the further back it would be. Lower objects would be towards the front.

It's an isometric perspective sort of like Baldur's Gate or whatnot.

Here is some code I wrote that works when 2 people overlap, but gets confused if 3 people overlap at once. So, it works half of the time.



Basically, I don't want someone higher on screen to end up in front or someone lower on screen to end up behind someone. It breaks the perspective rules.

Surely, there is a better way to do this.DrewMelton2014-02-04 07:07:51
B
79
S
30
G
35
Posts: 340
Reputation: 22,996

Post » Tue Feb 04, 2014 12:41 pm

There is a better way! You can do it in one event. Put all the objects you want Z-sorted into a family called IsoObject or whatever you prefer and set it up like this:
Ahr Ech2014-02-04 12:43:11
B
35
S
9
G
4
Posts: 201
Reputation: 5,170

Post » Tue Feb 04, 2014 9:54 pm

Sweet, that's definitely a lot easier than the way I was doing it. Thanks! :)
B
79
S
30
G
35
Posts: 340
Reputation: 22,996

Post » Wed Feb 05, 2014 3:11 am

@Ahr Ech,

mind = blown
B
81
S
32
G
23
Posts: 1,053
Reputation: 35,965


Return to How do I....?

Who is online

Users browsing this forum: beohs, boybacteria, Kyatric and 31 guests