How do I simulate depth in a 2D game?

0 favourites
  • 4 posts
From the Asset Store
Basketball Practice is HTML5 game written in construct 2 and 3 engine that simulates hooping.
  • Hello there,

    I would like to simulate depth in my 2D top-down game. Right now, sprites are overlapping but not like they are supposed to. The character with the higher Y value should always be in the back:

    I could do a Y check while players are overlapping and then moving the players either forward or backwards in the layer or z-axis but is there an easier maybe built-in solution?

  • It is on loop 'For each(ordered)' under system condition. When dialogue pop up pick the object then fill the expression with a criteria or object properties in your case the object Y properties for example objectsprite.Y. Set the order to ascending then put z order to 'Move to top' in action block.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It is on loop 'For each(ordered)' under system condition. When dialogue pop up pick the object then fill the expression with a criteria or object properties in your case the object Y properties for example objectsprite.Y. Set the order to ascending then put z order to 'Move to top' in action block.

    smart solution :) thank you!

  • > It is on loop 'For each(ordered)' under system condition. When dialogue pop up pick the object then fill the expression with a criteria or object properties in your case the object Y properties for example objectsprite.Y. Set the order to ascending then put z order to 'Move to top' in action block.

    smart solution :) thank you!

    There is actually a built in version, all you have to do is make a family, add a y variable and set the y variable to Family.Y, then use the sort Z order system action.

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