Brick Documentation

⌘K
  1. Home
  2. Brick Documentation
  3. Control
  4. If(...) is true then

If(…) is true then

Checks if a condition is true, and if it is, runs a set of instructions. It’s like saying, “If this is true, then do this.”

When the scene starts, the variable X is set to 0.

If the animal is now tapped, the variable X is increased by 1.
The program checks whether the variable X is equal to the value 2.
If this is the case, the sound Tweet1 is played and the variable X is set to 0.

How can we help?