Z order for 2.5D game

Get help using Construct 2

Post » Tue Mar 12, 2013 9:33 pm

I want to make some of 2.5D game like:
http://browserquest.mozilla.org/

But actually some techniques I don't know how to do:
For example: Let player walk around a tree..In case Player.Y< tree.Y then tree overlap player but if Player.Y>tree.y then player overlap.

Could CC2 does it..??
B
11
S
2
Posts: 73
Reputation: 1,438

Post » Tue Mar 12, 2013 9:38 pm

You would just set the stump of the tree to a solid and below the player with layers. Then make the rest of the graphics for the tree (just as sprites) and put then on a layer above the player.
B
50
S
14
G
12
Posts: 813
Reputation: 16,764

Post » Tue Mar 12, 2013 9:38 pm

Yes, you just change the zorder of the tree, or move it to a different layer. The following should point you in the right direction:

Just search the forums, pretty easy to find:

http://www.scirra.com/forum/zorder-place-in-front-of-another-Object_topic54906_page1.html

and this

http://www.scirra.com/forum/walking-in-front-behind-objects_topic64144_post393404.html#393404

Hope that helps...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Tue Mar 12, 2013 11:14 pm

Not sure if anyone else has made a better one since but I have a z-ordering example for this kind of game

Example

If you don't need different heights as well, as is the case in the example, then its just using 'For Each Ordered - by Y position - Move to top of layer.
B
14
S
4
G
3
Posts: 38
Reputation: 3,741

Post » Wed Mar 13, 2013 12:28 am

Thank all of you
@Tommyttk...I just concern about performance of game in case using 'For Each Ordered - by Y position - Move to top of layer.
It's mean my game redraw object every tick..??? and could it let my game is getting slow...??
B
11
S
2
Posts: 73
Reputation: 1,438

Post » Wed Mar 13, 2013 4:00 pm

Yeah i understand. I am not sure if it is a problem or not. I don't think it really is. I just made a game with hundreds of objects on screen webgl effects particles flying everywhere and with that kind of z-ordering event. It ran ok on a mid range pc from 2008.
B
14
S
4
G
3
Posts: 38
Reputation: 3,741


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], benajad, Braus, R0J0hound and 27 guests