Z position relative to Y.

Get help using Construct 2

Post » Thu Feb 09, 2012 7:12 pm

Ok so, I need some help, if you guys would be so kind :{

I'm making a game that follows the same conventions as classics as Golden Axe and Streets of rage. I thought they would be simple to make since they are old platforms so I gave it a shot. Although it's not hard, I'm having trouble with ONE thing in particular.

I need to set the Z position of the character to be relative to its Y position so that I can create this kind of movement:



The main idea was to set the origin point to each actor\object's feet and then place a:

"On Every Tick"
"Compare Variable if ACTOR.ImagepointY(0)>Object.ImagepointY" - "Actor Move top of layer"

I need something more pratical any ideas ?
B
19
S
2
G
3
Posts: 56
Reputation: 3,731

Post » Thu Feb 09, 2012 8:45 pm

I found a way to make it work, if someone finds a better way that relates to the Z axis.

For now I'm using

|For each "Object"
||Object.Y > Player.ImagepointY(0) - Move to top of layer
||Object.Y < Player.ImagepointY(0) - Move to bottom of layer
B
19
S
2
G
3
Posts: 56
Reputation: 3,731

Post » Thu Feb 09, 2012 8:55 pm

Why use Player.imagepointY(0) instead of Player.Y?
Also there is an unofficial plugin specifically for this:
Try it here.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Feb 18, 2015 12:50 pm

Hi!

I could made these effect with:

System Player.y > Player2.y Player2 Move to top of layer

-

System Player.y < Player2.y Player2 Move to Bottom of layer


With that, the system is always comparing if the Y is Less or Greater than another object and send it Top or botton in the layer.

If you don't define that, the system is always putting the sprites in te top of the layer.


Note:

< Is (Less or equal)
-
-
B
3
Posts: 3
Reputation: 181

Post » Wed Feb 18, 2015 8:51 pm

There was a related thread last week, though it's not quite the same: Thoughts on pseudo Depth.
If you're only going to be sorting two or three items, you could do the forEach loop where each object, based on ascending Y order, is put on top in turn.
B
11
S
4
Posts: 152
Reputation: 1,236


Return to How do I....?

Who is online

Users browsing this forum: djcrazypants, marekmk and 5 guests