How do I use the OR block correctly?

0 favourites
  • 7 posts
From the Asset Store
Physics Block Puzzle game template for Construct 3
  • I try to understand how to use the OR block correctly.

    The documentation states: "You can also create OR blocks which run if any condition is true, rather than all the conditions. See How events work for more information." and "the event will run if "condition 1 OR condition 2 OR condition 3..." are true."

    I have an event in which I register the tap on a sprite. I have two OR conditions which ask for the current game state ("show results" and "boss waiting"). I'd assume that the game only executes the following actions when the conditions are met.

    BUT I have another event block which also registers the tap on the same sprite. It too has its own condition "game lost" which results in another action than the first event and should ONLY trigger when the condition "game lost" is met.

    But as soon as I set the first event to OR, it does not care which game state is active, it executes the action even if the game state is "game lost".

    Did I use it wrong? Is this a bug?

  • Can you post an image of your blocks? So I can understand better

  • The game always goes back to the main menu, even if the game state is "game lost".

  • OK so, the second block will trigger the first one too.

    Because you have an action setting GameState to "ShowResult" and on the first block there is a comparission: If GameState = "ShowResult". As you have it using OR, it means that if just that one is true, it will trigger.

  • Thanks, I would have assumed that I have to lift my finger again before a new "on tap gesture" is registered.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A good way to organize events so only one branch trigger would be like this :

  • Ah, so its possible to use the else in that way? I tried it before, but I only could add an else to the main event, not the conditions underneath. By the way, this setup works as well, although it is very similar to the first one.

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