"Or" block with two conditions

Get help using Construct 2

Post » Sun Jun 22, 2014 10:15 pm

I'm trying to create the following logic:

If Touch is touching mySprite

OR

If Mouse Cursor is over mySprite

AND

If Mouse Left button is down

--> doStuff

My attempts so far lead to the "AND" part being replaced with "OR". In other words I get two "OR"s when I only want one "OR" and one "AND".

Basically I'm asking if it's possible to have two different conditions launching an event so that the second condition checks two things?
B
9
S
1
Posts: 97
Reputation: 715

Post » Sun Jun 22, 2014 10:20 pm

You can't do that in one event. Add the AND condition as a subevent.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Sun Jun 22, 2014 10:23 pm

Ok, thanks for the quick reply!
B
9
S
1
Posts: 97
Reputation: 715

Post » Sun Jun 22, 2014 10:24 pm

blackhornet wrote:You can't do that in one event. Add the AND condition as a subevent.


That's the sad truth. It would be nice if it could be done, sometimes this restriction leads to repeating events and actions unnecessarily
B
6
S
2
Posts: 79
Reputation: 608

Post » Sun Jun 22, 2014 11:37 pm

Yes, this is one of those situations in which it would be nice to be able to write custom code.
B
9
S
1
Posts: 97
Reputation: 715

Post » Mon Jun 23, 2014 12:07 am

You can do one expression, but it's not pretty:
Compare two values: (Variable1=1 | Variable2=2) & Variable3=3 "Equal to" 1
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 45 guests