Walk behind an object (Layers and 2.5 D Games)

Get help using Construct 2

Post » Wed May 22, 2013 2:19 pm

What I'm tying to do is build a wall in 2.5 D

I have the character controlled by 8 direction, and I set the collision box to only the base of the wall. See the image below...

In Red: What is happening right now (character is on top of the wall image)
In Green: What I want to happen (character is behind the wall image)
In Black: Wall
In Blue: Wall Base (the collision part)



How do I fix this?
B
6
Posts: 35
Reputation: 370

Post » Wed May 22, 2013 2:38 pm

Hi @JoshWegener,

You could put the red and green characters on different layers (1 above the wall layer and one below). That way the green sprites would always look as if they are walking behind the wall.

Hope that helps you!


Edit - Sorry, think I may have misread the post! But if you are looking for a way to make your sprites walk behind the wall the same advice applies. Just make sure that you spawn your sprites on a layer which is below the wall layer! Blacksmith2013-05-22 14:45:24
B
32
S
6
G
7
Posts: 489
Reputation: 8,217

Post » Wed May 22, 2013 2:46 pm

Im not sure where your problem is, I try to explain you what I would do.

Black Z-index = 1
Blue Z-index = 2
Green Z-Index = 3
//Can also be done with Layers

Blue = Platform


+ Green is overlaping Black
+ trigger once
++ Green is overlaping Ground(I Hope you have an image for the ground)
---> Set Green Z-Index behind Black or one Layer behind Black
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Wed May 22, 2013 2:50 pm

I updated my images... The RED is what is currently happening (and I don't want that)... Green is what I want to happen...

B
6
Posts: 35
Reputation: 370

Post » Wed May 22, 2013 2:51 pm

@Darklinki the entire black/blue is the wall... the blue part is just collision box.

Currently, it's all on the same layer.
B
6
Posts: 35
Reputation: 370

Post » Wed May 22, 2013 2:55 pm

So the player cant move on the blue part ? So you just want to let him move behind and in front og the Black wall ?
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Wed May 22, 2013 3:18 pm

@Darklinki Correct

In this game I'm working on, there will be lots of objects like this... that the player can walk behind or in front of.
B
6
Posts: 35
Reputation: 370

Post » Wed May 22, 2013 3:42 pm

I had the same problem in a game I'm working on. Just install rexrainbow's Z-Sorter Plugin and use that.
B
25
S
8
G
8
Posts: 71
Reputation: 5,307

Post » Wed May 22, 2013 3:59 pm

Without any plugin just check the Y of the sprites, send the spite to top or bottom of layout.

For example you could add every object in a family and do :

For each (ordered) Family order by Family.Y -> Family Move to top of the layer.

B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Wed May 22, 2013 4:25 pm

@Zephlon Could you link me to the plugin page (not just the zip)?

@Joskin Thanks! (I can't do families in the free version... thinking about buying today...) Just trying to make sure that this application can handle my game...
B
6
Posts: 35
Reputation: 370

Next

Return to How do I....?

Who is online

Users browsing this forum: kamens503, Yahoo [Bot] and 22 guests