Walk behind an object (Layers and 2.5 D Games)

0 favourites
From the Asset Store
Be discreet and rescue your friends from behind enemy lines.
  • something went wrong with the links hope this works now

    Example

    distance scale

  • Best way to do it is to use families.

    +For Each (Ordered) FAMILY, Sort by Y Ascending
    -> FAMILY : Move to top of layer

    If you can't use families, then the Z-sorter plugin mentioned earlier would work fine, too.

    Don't really recommend any other methods since the above two are the simplest ways to do it.

    pixel perfick

    Moving characters from Layer to Layer is not the same as changing the Z order. In each layer you have an X,Y, and Z coordinate. Z decides which object gets drawn on the top. Moving from Layer to Layer isn't practical for top down games because if you have a large number of characters/objects on screen, you'd need a layer for every one of them in order to properly display "depth", in every layout. Way more work than necessary, and likely a bad idea for performance as well (haven't tested layer limits myself). Layers are better used for parallaxing, HUDs, forest canopies, cloud shadows, weather, fog, environmental effects, backgrounds, collision layers, etc... rather than sprite sorting.

    Besides, why make 100+ layers to accomplish what can be done in 1 event?

  • I went and got the paid version... I created a family with the wall and with the player object... I'm not sure how to setup the event.. I found the foreach, but I can't find a sort anywhere... and do I want to run this every tick? or on player move? or?

  • Ah! I got it working!

    View Demo

    Download capx

  • (Note, the RED thing is the wall, with the hitbox in yellow. The blue this is the "player" with yellow being the hit box. Use the arrow keys to move.

    I did On Player Moving, do the sort.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ninja'd

  • I know layers are not exactly the same as the z order, I said as long as there is no parallax happening, I meant from a graphical point of view and for the purpose of the example given it would work...

    Joskin told him how to do it using families on page one...

  • pixel perfick Well Thank you! ... I'm very new here, first day with the application...

  • JoshWegener welcome to the forum....Nice medal ya got there!... <img src="smileys/smiley2.gif" border="0" align="middle" />

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