# How do I Create Condition "OR" and "AND" altogether

0 favourites
• 7 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
• I want to make conditions like this:

Condition1 or (condition2 and condition3)

If I use or block, all the three conditions become like this

Condition1 or condition2 or condition3

How to do this?

Thank you

• LocalVariable = 0

If Condition2 and Condition3, set LocalVariable to 1

If LocalVariable =1 or Condition1, do something....

• or -

If Condition2 and Condition3, set LocalVariable to 1

If Condition1, set LocalVariable to 1

If LocalVariable = 1, do something....

They're not particularly eye pleasing but they'll do the job.

• you can compare two values in the System condition, and then put something like this for the first value:

( a=1 | (b=2 & c=3) ) ? 1:0

equals

1 (for the second value)

the ? checks if it is true, if so, uses value of 1, otherwise if it is false uses a value of 0.

This value then gets compared with the value you put in the second input box.

• Prominent has given the expert, non-event sheet slave, answer! I need to read some programming books!

• Prominent & Colludium, thank you for your response.

I create an event, check condition1 and then I make sub event to cek condition 2 or condition 3.

• ## Try Construct 3

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

Construct 3 users don't see these ads
• Prominent The ternary part is not needed. The expression (a=1 | (b=2 & c=3)) already gives a value of 1 (true) or 0 (false).

• Magistross Ah! good point, thanks man!

• 7 posts