How to make so character is in front of object

Get help using Construct 2

Post » Thu Jan 23, 2014 6:20 pm

There are 4 layers
HUD
Main
Overlay
Background

I have my character and AI in Main. I want so when he is behind the guy that the guy is on top of him. Then when he walks in front, he is on top of the enemy. Here is a screenshot of what I mean, Please help!

h t t p : / / o i 3 9 . t i n y p i c . c o m / 1 5 7 p 6 6 u . j p g

I had to space it since scirra wont let me post links D;
B
1
Posts: 6
Reputation: 137

Post » Thu Jan 23, 2014 6:26 pm

Bump, my computer is shutting down and I can't find its charger.... Please answer the question, thx :D
B
1
Posts: 6
Reputation: 137

Post » Thu Jan 23, 2014 6:49 pm

Add a layer above Main and move your object between layers as appropriate?
You'll need an event to keep track of when your guy is in front or back of the enemy. Construct is a 2d platform and you're trying to do 3d or at least 2.5 so you'll have to get creative.

+ Every tick
- if player.y < enemy.y then enemy is in front of player (switch enemy to new layer)
- else if player.y > enemy.y then enemy is in back of player (switch enemy to overlay layer)
B
17
S
4
Posts: 31
Reputation: 1,600

Post » Thu Jan 23, 2014 7:38 pm

ImageImageImage
B
71
S
21
G
229
Posts: 3,686
Reputation: 128,336

Post » Thu Jan 23, 2014 7:38 pm

Instead of adding a layer you could also adjust the z-order through events.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jan 23, 2014 8:15 pm

agreed, z-order would be better than what I proposed.
B
17
S
4
Posts: 31
Reputation: 1,600

Post » Fri Jan 24, 2014 1:36 am

Bump, how do I use the Z order?

Sorry im a little newbish.

Where would I begin?
B
8
S
1
Posts: 62
Reputation: 627

Post » Fri Jan 24, 2014 1:42 am

I posted a link.
ImageImageImage
B
71
S
21
G
229
Posts: 3,686
Reputation: 128,336

Post » Fri Jan 24, 2014 2:14 am

Thx, how did u create groups?
B
8
S
1
Posts: 62
Reputation: 627

Post » Fri Jan 24, 2014 2:15 am

And does that group engolf the player and npc?
B
8
S
1
Posts: 62
Reputation: 627

Next

Return to How do I....?

Who is online

Users browsing this forum: Laura_D, plinkie and 20 guests