overlap sprite issue

Get help using Construct 2

Post » Tue Jan 14, 2014 1:15 pm

hi guys, I don't know how to explain this using a simple word. so here's the case:

When my character sprite is overlapping a building or another character it should go in front of it in term of Z Order. But if it comes from behind the building, it should be behind it. I already make some examples with the Character-Building interaction, but I can't think of a way for the Character-Character interaction. I still can't post URL but I can procide you with link to my capx.
B
6
Posts: 3
Reputation: 581

Post » Tue Jan 14, 2014 4:25 pm

Assuming your game is top-down, would something like if character.y is less then character2.y then set character z order to the back work?
B
62
S
20
G
56
Posts: 1,077
Reputation: 36,021

Post » Sat Jan 25, 2014 9:14 am

what if the character if of the same sprite?
B
6
Posts: 3
Reputation: 581

Post » Sat Jan 25, 2014 12:55 pm

even if the characters are the same sprite, each instance will have different UID's so you can sort them that way.

the easiest way is to get the plugin Zsorter

then use
every tick -> zsorter Sort all objects on layer 0 by Y


B
90
S
44
G
17
Posts: 1,012
Reputation: 18,527


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests