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

  • 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.

    I'm really lost, is it not that what I gave you on the capx? have you checked it?

    If you checked the example and is not what you need, can you explain what in my example is wrong?

    The only difference I don't make the dead zone as you because I don't know how you make the dead zone but I think the events to how you check overlap will be the same so that shouldn't be a problem

    On my example you got:

    If Walls overlap player: True

    AND Player overlaps Dead Zone: true

    Dead Zone overlaps walls the same that Player overlaped: true

    Action: Then set Player animation = red

    Will be easier if you could just post a small demo, you don't have to post your whole project just make a small demo enough to make the point, that it shouldn't take you long

    =============================

    Also when you say "But I want Dead angle over walls to be true." what exactly you mean with that?

  • The problem (if I understood correctly) is illustrated by this image: Painter's problem

    This is from the Wikipedia article on the Painter's algorithm, which is the type of algorithm Construct uses for rendering.

    One solution in this case could be to cut the green rectangle in half (making it two objects), so the right part can be layered under the red rectangle, an the left part layered over the blue rectangle.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I checked your capx but it doesn't solve the problem. Forget my project it just makes it more complicated.

    And just look at the picture Ashley sent.

    It is the painter's problem. Because of the Painter's algorith Construct 3 uses it's impossible to make Green over Blue and at the same time under Red.

    The best solution is exactly what Ashley said: cut the geen in half. And layer one part over Blue and the other one under Red.

    But I actually solved it on my own^^; because in my case Green is pinned to Blue. I can have Green at the highest layer and erase the overlapping part between Green and Blue.

    (So it looks as in the Painter's problem photo but the only difference is that the overlapping part between Green and Blue is erased)

    If that makes sense.

  • tarek2 Ashley

    Thank you that you gave me fast answers and help:)

  • Woow I'm not gonna lie to you at the end I was completely lost and my brain smashed into pieces on this one lol :))

    In your opening post, you talked about overlapping only but it looks like your problem it was the Z ordering of the objects if I understood right by looking in the pictures that Ashley posted.

    So the problem is if you talk about only overlapping the issue is that when two objects overlap doesn't matter which one is on the top or bottom both counts as overlap:

    Example:

    (A is on Top of B)

    A overlaps B

    B overlaps A

    Both are correct as both overlapping each and doesn't matter who is on top or who is on the bottom at least this how C2 Events works, both conditions will be true if you test both conditions one by one separately.

    So that's why I was following your original question and how C2 Events works: and I just concentrate on overlaps in general (Collisions or which objects are touching) ignoring the Z-order.

    So if you wanted to make it more clear from the beginning you could just have talked about the Z ordering:

    Example:

    Walls have to be at the top (Oberlaping Player & Dead zone)

    The player on the Middle (Overlapping dead Zone)

    The dead zone has to be at the bottom

    Position Z ordering Matters

    Now all made sense as you when you were referring (A overlaps B) in the true you meant (A is on top of the B) so if (B was on top of A) then for you doesn't count as overlap if I'm not mistaking.

    So there is it the whole confusion

    Example:

    For you: if you looking (A Overlaps B) so if (B was on top of A) then for you doesn't count as overlap if I'm not mistaking.

    For a C2 User: (A Overlaps B) so if B was on top of A then for us it counts as overlap as is touching it.

    I'm glad Ashley made the problem clear as I don't think I would have figured out by just looking into "Overlapping" in general by C2 definitions, as it doesn't have the concept of who is on (Top or Bottom)

    Anyway, I'm glad you found a solution:)

    I will keep it in mind this whole overlap (Different Perspective View) thing just in case I end up on the same situation in the future Jeje

  • If your dead angle is a sprite, you can cut out the part that overlaps the player and make it transparent.

  • tarek2

    Ah hahah now I understand how we got confused. I was using the wrong terms^^

    oosyrag

    Yes thank you

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