How to manipulate objects in Z order ? Which is on top?

0 favourites
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • to make this a little bit simpler, maybe avoid the z order? i generally only use z order to enforce a foreground and background, and to save myself from using a second layout/layer for a main menu screen. however, you can do something along the lines of (add event)"If A is overlapping B" (add condition) "If B is overlapping C" (add action) Go To Layout

  • also, if you need them to be more than just overlapping but overlapping in aspecific spot, put an invisible box named D etc

  • I tried that what u're writting... but there is no difference if object A is overlapping object B , or object B overlapping object A.. :/ I thought it make difference but it doesn't.. So i think there is no simply way to do that..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i have an answer for you but i do not have time to type it out atm, however, if youre still on in an hour or so ill answer this

  • Sure, its still actual It will be great!

  • Wouldn't this condition work?

    System->compare triangle.zorder < square.zorder

  • so i was gonna try to get specific but as i dont know excactly what youre doing i dont want to confuse you, but consider attempting making global variables and calling them layers,using numbers to specify , and then have something along the lines of if #>highest layer set to 1 and then add 1 to each layer so as each object would have its own number, or certain actions could send different objects to the same 'layer' etc. if its just for functionality, this should work. used in conjunction with the "send to top of z order" command, it shouldnt be too hard to rig something up. although i did do a test with 3 blocks, where if sprite.zindex =0 play sound 1, sprite 2 = 0 play sound 2, etc, (with condition trigger once while true so as to stop infinite loops), and clicking sent them to the top of z order, and same blocks would play different sounds, even though every time i clicked them they would visibly be on top, and sometimes switching between 2 without going to the 3rd would cancel the desired action. so for what its worth, i see what youre going through lol.hopefully the variables as layers option works for you

  • Ok. Finally i found the best and the simpliets way to do what i wanted !!

    Thanks the_Shit_Hawks for your soultion. I made something like that:

    Looks simply as fun.. And it works very well!!

    Thank you guys!

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