How do I make A overlap B, B overlap C and C overlap A?

0 favourites
  • Hi again!

    This question is simple and I wonder:

    Consider 3 objects

    Is it possible to make A overlap B, B overlap C, and C overlap A?

    Example: it's a 2d top down shooter: Walls overlap player, player overlaps dead angle (dark zone behind the player: where the player can't see), dead angle overlaps walls:

    Thank you for all help <3

    Roland

  • This is not possible to achieve with Construct's 2D renderer. Everything is drawn one after the other on top of the previous content. This kind of result can only be achieved with a 3D renderer (using a depth buffer to determine overlap per-pixel). In 2D you'll have to work around it, maybe by cutting up objects in to different segments.

  • Ok thank you that's what I wanted to know:)

  • rolandzarmy Can you give a visual example like a PNG to what you trying to do exactly?

    I didn't understand this part

    "player overlaps dead angle (dark zone behind the player: where the player can't see)"

    How he can overlap dark zone if it's behind him all the time? didn't make sense to me

  • tarek2

    Of course,

    Here as you can see Walls overlap player, player overlaps dead angle (which is actually a sprite pinned to the player), and Dead angle should (but doesn't here) overlap the player.

    But as Ashley said I could instead try to erase some part of the line of sight so it fits to the player image.

  • Wow forgot the picture...

  • Thanks rolandzarmy that's much better

    I'm still trying to follow what you say

    who is the dead angle? Grey object?

    Who are the Walls? Black object?

  • tarek2

    Yes sorry for not being clear enough. I'll do my best. The walls are the grey objects. The black shadow behind the player is actually a sprite and not a shadow. The other black parts are shadows (you can ignore them as they are not part of this question).

    I want the wall to be over the player as you can see in order to make it a little bit more 3d.

  • tarek2

    Yes sorry for not being clear enough. I'll do my best. The walls are the grey objects. The black shadow behind the player is actually a sprite and not a shadow. The other black parts are shadows (you can ignore them as they are not part of this question).

    I want the wall to be over the player as you can see in order to make it a little bit more 3d.

    Haha Thanks, we getting there slowly

    Forgive me but its all-black there I cannot disguise the Shadows from the dead black zone, could you colorate the dead zone on a different colour? so we know who is who as I still don't understand how it will ever overlap the dead zone if its always behind the player

    This is one of those tricky ones to understand if you don't explain it with precision

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Or even better can you share a demo? that will be quicker

  • So implified the whole thing to make it simple

    I don't know how to make a demo but I think it would just confuse you. I deactivated the shadows. So here you see the player between two walls. The walls are over the player to make a little 3D effect.

    I put the Dead angle (black thing) on top. It looks cringy like this. So this is why I prefer the player being on top of the Dead angle, Dead angle being over walls (so you can't see them behind you when looking in the opposite direction) and the walls being over the player.

    Hope it makes it clearer enough;)

    Tanks for for considering the subject.

  • rolandzarmy

    If I understood correctly this is what you need as you say you use Sprites objects for (Walls & Dead Zones)

    So Following your original request:

    Target:

    -Walls overlap Player

    -Player overlaps dead zone

    -Dead Zone overlaps walls

    Capx: https://www.dropbox.com/s/g8zynip5dj53hal/1-oberlaping.capx?dl=0

    Drag Player blue Object and check for overlaps

    If it's not this what you need let me know what is wrong with it

  • tarek2

    Sorry I feel I wasted your time. You got it with the Walls over Player over Dead Angle over Walls.

    This is the example

    Walls over player: check

    Player over Dead angle: check

    Dead angle over walls: no

    Hopes it makes it clear lol.

  • Sorry I didn't get it fully

    Walls over player: True

    Player over Dead angle: true

    Dead angle over walls: No true

    Are you saying that Dead zone shouldn't overlap walls?

    but player & Wall should be overlapping

    & player should be overlapping dead zone at the same time

    is that correct?

  • No lol.

    It was in my example (the picture) that:

    Walls over player: True

    Player over Dead angle: true

    Dead angle over walls: No true

    But I want Dead angle over walls to be true.

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