Let two cues overlap
BASIC IN YOUR GAME
A bell and a whistle can start on different beats while the same script waits for both to finish.
FUNCTION Run()
PARALLEL
WAIT 0.05
PRINT "Bell"
BRANCH
WAIT 0.1
PRINT "Whistle"
END PARALLEL
RETURN "Both finished"
END FUNCTIONThe first branch waits 0.05 seconds, then prints Bell. The second starts alongside it, waits 0.1 seconds, then prints Whistle. After both finish, the function returns Both finished.
| AWAIT | Marks a gameplay call that waits for completion. BASIC also waits for gameplay calls automatically. Check action options such as wait or waitForContinue when choosing when that action finishes. |
|---|---|
| BRANCH | Keeps the statements in one branch in sequence. Without BRANCH, each statement directly inside PARALLEL starts independently. |
| Shared data | Each branch has its own local values. An assignment there does not update the parent’s local variable. Avoid having two branches change the same global counter at once. |
