Basics of scripting

From Fancade Wiki

Some blocks have wires sticking out of them. These are script blocks and you script by connecting their wires to other script blocks.

When you tap Play, script blocks execute (activate) and do their thing. E.g. Set Score sets the current score, so if we wire the Number 3 to it, the score is set to 3.

Basics set score.png

Blocks execute top-to-bottom, left-to-right. But you can plug in the yellow control wires to change the execution order. This is especially useful when you want to execute a block only some of the time.

(see Execution order for more details)

For example, here I've wired a Touch Sensor to Win, so when the player taps, then the game is won:

Basics tap to win.png

There are other wire colors as well:

  • Blue is a number
  • Green is an X,Y,Z vector (such as a position)
  • Orange is a rotation
  • Red is a Truth, it is either True or False
  • Pink is an object
  • Gray is a constraint
  • Yellow is for execution control

That's the basics! Now, you'll probably learn a lot more by looking at some example scripts that show how to do useful game stuff. So start Fancade and look on the Build tab to find a game called "Tutorial". It's fully editable, so you'll be able to see and play around with each example script.