Walking in front/behind objects

Get help using Construct 2

Post » Tue Feb 26, 2013 1:02 pm

Hey all,

I'm creating a little game where you can navigate a sort of top down game world with a player character but I've run into some trouble getting my player character to walk in front of objects as well as behind them like in a 3D space. I've managed this for two houses but it requires a lot of events and only works for one instance of the object so I can only place one of each house in the scene.

Is there a simpler way to achieve this, like a global solution to all objects in the layout?

https://www.dropbox.com/s/4jcsbsgrtru1vw4/Prelude.capx
B
2
Posts: 4
Reputation: 258

Post » Tue Feb 26, 2013 1:46 pm

Should be quite easy with families... just add to them as needed :D

I've edited your test to show how i'd do it:
https://dl.dropbox.com/u/45711709/Z-Order.capx
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Tue Feb 26, 2013 2:53 pm

Oh, I should have mentioned that I'm using the free version still. Is there any way to achieve a similar effect on there?
B
2
Posts: 4
Reputation: 258

Post » Tue Feb 26, 2013 3:22 pm

You can use separate layers. Have a layer with invisible blocks/sprites on it and mark them as solid so you can't walk through them. These sprites would match up with the bottom of your house/buildings. The actual houses, etc... would be on a layer above the player so that if the player is not running into a solid block, you get the affect that the player is behind the house. Also, do a bit more searching on the forums, I forget which thread but someone had a great way with events to move the houses/buildings to a lower or higher layer depending on where you were in relation to them which gave the same effect.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Tue Feb 26, 2013 3:26 pm

I think what u need is Z order plugin
It is available even to the free edition i think
It makes all the sprites in the current layer to arrange along Z based on the X and Y coordinates
So when the origin of a sprite is at position Y-100 for example, all sprites that are Y<100 will be placed behind that sprite and all that are Y>100 will go over it

Hope it helps
B
12
S
3
G
1
Posts: 120
Reputation: 1,829

Post » Tue Feb 26, 2013 3:27 pm

Thanks guys, I'll have a look at that! Will post the results.TheDuckbunny2013-02-26 15:28:30
B
2
Posts: 4
Reputation: 258

Post » Tue Feb 26, 2013 5:26 pm

Got the Z order plugin and it works like a charm! Thanks a lot guys.
B
2
Posts: 4
Reputation: 258


Return to How do I....?

Who is online

Users browsing this forum: Matthew de and 26 guests