No comments, but over 2200 views, so I guess you want more. <img src="smileys/smiley2.gif" border="0" align="middle" /> I take newt's suggestion, so here's
Tips'n'Tricks #3: Conditionals
Construct Classic offers a shortcut for simple 2-state conditions. Let's say we have a game with a mean boss that talks to us. Whenever the player is near the left border, the boss should say: "I can see you!" but else the boss will say: "Where are you?"
With normal events, it would look like so:
+ Sprite: X Less than 200
-> Text: Set text to "I can see you!"
+ System: Else
-> Text: Set text to "Where are you?"
Already only two events. But you can express it in just one event, using conditionals. The way to use them is easy. Wherever you can enter an expression, you can use the syntax "condition ? a : b"
The condition will be either true or false. If true, a will be executed, if false, b will be executed. Easy. And this is how it looks like in an event:
+ System: Always (every tick)
-> Text: Set text to (Sprite.X < 200) ? "I can see you!" : "Where are you?"
Now you might think it is too restrictive, because it only knows two states? For example, you might want the boss to say "I can see you!" whenever the player is near the left or the right border. You shouldn't use "or" to evaluate events, but you can do it this way:
+ Sprite: X Less than 200
-> Text: Set text to "I can see you!"
+ System: Else
+ Sprite: X Greater than 440
-> Text: Set text to "I can see you!"
+ System: Else
-> Text: Set text to "Where are you?"
You can't use conditionals for something like that, can you? You can! The best about conditionals is that you can call a function.
We set up this function:
+ Function: On function "nearBorder"
-> Function: Set return value to 0
++ Sprite: X Less than 200
--> Function: Set return value to 1
++ Sprite: X Greater than 440
--> Function: Set return value to 1
Then we call:
+ System: Always (every tick)
-> Text: Set text to (Function.nearBorder = 1) ? "I can see you!" : "Where are you?"
Of course, you can create much more detailed functions. As long as they return one of two values, you can realize pretty much anything. And using conditionals can simplify your event sheets and make them more clear and well arranged.