6. Control

Control code blocks are responsibile for directing the flow of your code and program.

6.1. Waiting

You may force your program to wait.

_images/00-wait.png

This code block forces your program to wait for a specified amount of seconds.

_images/05-wait-until.png

This code block forces your program to wait until a termination condition is satisfied.

Code

6.2. Loops

To make your program repeat something over and over, use the following loops.

_images/01-repeat.png

This code block repeats code for the specified amount of time.

_images/02-forever.png

This code block repeats code forever.

_images/06-repeat-until.png

This code block repeats code until a termination condition is satisfied.

Code

6.3. Conditionals

Conditionals are responsible for decisions.

_images/03-if.png

This code block executes code only if the specified condition is satisfied.

_images/04-if-else.png

This code block executes one of two code blocks.

Code

6.4. Stopping

You may stop your program using the following code blocks.

_images/07-stop-all.png

This code block stops all code.

_images/08-stop-this-script.png

This code block stops the specified script.

_images/09-stop-sprites.png

This code block stops other scripts.

6.5. Clones

You may also listen for clone events. Cloning is the act of copying and creating a new object from another.

_images/10-when-i-start-as-clone.png

This code block listens for when an object starts as a clone.

_images/11-clone.png

This code block creates a clone.

_images/12-delete-clone.png

This code block deletes a clone.