Conditions overlapping

0 favourites
  • 8 posts
  • Hi folks,

    I have encountered a strange problem!

    I want to check wether the player colides with different rectangles. So far my Actions look like this:

    <img src="http://i39.tinypic.com/wu19fn.png" border="0" />

    But I noticed that only the two bottom actions/conditions are working. They seem to override the top ones.

    Does anyone know how to fix this?

  • System: Every tick
      -> t_Overlay: set Invisible
    Player: Is overlaping Cave_top
      -> t_Overlay: set Visible
    Player: Is overlaping Cave_bottom
      -> t_Overlay: set Visible
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, this works perfect!

    Can you maybe explain why my way didn't work?

  • Because of event order

    The last one on the list is : if Player isn't over Cave_bottom, then sent t_Overlay to invisible

    So event if you are over Cave_top the last event will be true then t_Overlay will be invisible

  • Another way would be to join the two inverted conditions into one event. (putting conditions together is like using 'and')

    That way the order doesn't matter...

    Thanks, this works perfect!

    Can you maybe explain why my way didn't work?

    Your original way did not work because for example: player can be overlapping the cave_top at the same time as NOT overlapping the cave_bottom..

    as you said, they were overriding

  • Okay, I didn't think about the order. Thanks! :)

    Functional seen the two solutions given are no difference, aren't they?

    And I think the speed should not differ much either...

  • Technically, it's more performatic to make two events with both conditions, because you won't be setting/resetting some attribute over and over to the same object.

  • You mean like keepee mentioned?

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