Z position relative to Y.

0 favourites
  • 5 posts
  • 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:

    <img src="http://s16.postimage.org/hb144ix7l/SOR.gif" border="0" />

    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 ?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • Why use Player.imagepointY(0) instead of Player.Y?

    Also there is an unofficial plugin specifically for this:

    Try it here.

  • 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.


    < Is (Less or equal)



  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)