Dynamics Z order sort

Get help using Construct 2

Post » Tue Sep 03, 2013 10:54 pm

I'm thinking how to have a Z order sort to know each object is in front of another, but dynamically/in real time. The idea is to work in a game like Streets of Rage that when the player is in the lower part of the screen he is in front of something that is a bit upper. But to make it works it needs to be in real time, the game must compare the Y position of each element and put them in the correct order. Is it possible?
B
2
Posts: 6
Reputation: 162

Post » Tue Sep 03, 2013 11:37 pm

It is really easy if you think about it , you put all the objects you want in a family and then ;

For each Family ( ordered , from smallest X to biggest X )
-- Family | Move to top
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,481

Post » Tue Sep 03, 2013 11:58 pm

I tried different. I compared the Y, if it's bigger then "Move to front", if it's smaller "move behind". It will be a bit complicated if there are many objects, but it's working well.

Another thing,I'm using the 8 direction behavior. How can I simulate a jump? The behavior has 8 directions and works well, but how can I pressing a button (jump button) can do the player go up on Y and after go back to the original Y? When it does it it can call a jump animation for example.
B
2
Posts: 6
Reputation: 162

Post » Wed Sep 04, 2013 1:50 am

My bad , I meant Y :P

anyways , to respond to your question , you could try the sine behavior ...
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,481

Post » Wed Sep 04, 2013 1:55 am

u should try the zsorter plugin, it works very well!

http://www.scirra.com/forum/plugin-isometric-z-ordering-based-on-y_topic46247.html

or rex_zsorter

https://dl.dropboxusercontent.com/u/5779181/C2Repo/Zip/plugins/rex_zsorter.7zGuif0DA2013-09-04 02:15:19
B
32
S
6
G
5
Posts: 437
Reputation: 6,119


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests