Z order confusions

This forum is currently in read-only mode.
  • Hi everyone!

    I'm making a game and it's been smooth sailing so far, but I've run into my first problem. Z order.

    The player should go behind the trees when he is above them, and in front when he is below them. This only happens for some trees, the rest just don't work properly.

    Here's my .cap: http://dl.dropbox.com/u/7129504/Rpg.cap

    The code for the z order is at the bottom of the events list. Am I doing it wrong? Is there a simpler way of doing this?

  • Use the is overlapping condition with your events to select the correct tree to place behind/in front of.

    <img src="http://dl.dropbox.com/u/5426011/pics/events2.GIF">

    Repeat that for all 3 trees.

    Or you could add all three trees to a family, say "Terrain", and change the tree references in those three events to Terrain. That way all the trees will be handled in just three events. It also makes it simpler to add other visual blocks such as signs, rocks, etc... without the need for extra events to do the sorting.

  • Ah ok, I get it. Just one question, how do I find the Y coordinate of a family? I've added all 3 trees to the Terrain family, but I can't seem to find it in the event editor.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When inputting an expression

    Double-click on any object.

    Click back.

    You should now see a list of all the families in addition to objects.

  • Thanks R0J0hound, you've been a great help

    I'll update this thread if I run into any more z order problems.

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