Prevent Execution of multiple IF statements

Get help using Construct 2

Post » Thu Jul 19, 2012 3:22 pm

It's been a while since I have made some games with C2, and I can't remember how to fix this:

I got a button event.

If Red -> set Blue

If blue -> set Green

The problem is now that It first executes If Red-> set blue
and then goes on to set Green because it is next in the code..

How to prevent that?
B
40
S
11
G
4
Posts: 665
Reputation: 8,453

Post » Thu Jul 19, 2012 3:24 pm

Well, you could use a local variable. When one of IF statements is met, flip the variable on and test against it in all of those IF statements.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,185

Post » Thu Jul 19, 2012 4:09 pm

Use the System->Else condition

If Red -> set Blue
Else
If blue -> set Green
Find all the Construct 2 games that were on Steam Greenlight here
B
36
S
10
G
7
Posts: 479
Reputation: 7,023

Post » Thu Jul 19, 2012 4:43 pm

Easier solution wins!

Thx u 2
B
40
S
11
G
4
Posts: 665
Reputation: 8,453


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests