Walking in front/behind objects

0 favourites
  • 7 posts
From the Asset Store
Be discreet and rescue your friends from behind enemy lines.
  • Hey all,

    I'm creating a little game where you can navigate a sort of top down game world with a player character but I've run into some trouble getting my player character to walk in front of objects as well as behind them like in a 3D space. I've managed this for two houses but it requires a lot of events and only works for one instance of the object so I can only place one of each house in the scene.

    Is there a simpler way to achieve this, like a global solution to all objects in the layout?

    dropbox.com/s/4jcsbsgrtru1vw4/Prelude.capx

  • Should be quite easy with families... just add to them as needed :D

    I've edited your test to show how i'd do it:

    dl.dropbox.com/u/45711709/Z-Order.capx

  • Oh, I should have mentioned that I'm using the free version still. Is there any way to achieve a similar effect on there?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use separate layers. Have a layer with invisible blocks/sprites on it and mark them as solid so you can't walk through them. These sprites would match up with the bottom of your house/buildings. The actual houses, etc... would be on a layer above the player so that if the player is not running into a solid block, you get the affect that the player is behind the house. Also, do a bit more searching on the forums, I forget which thread but someone had a great way with events to move the houses/buildings to a lower or higher layer depending on where you were in relation to them which gave the same effect.

  • I think what u need is Z order plugin

    It is available even to the free edition i think

    It makes all the sprites in the current layer to arrange along Z based on the X and Y coordinates

    So when the origin of a sprite is at position Y-100 for example, all sprites that are Y<100 will be placed behind that sprite and all that are Y>100 will go over it

    Hope it helps

  • Thanks guys, I'll have a look at that! Will post the results.

  • Got the Z order plugin and it works like a charm! Thanks a lot guys.

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