GM: Loop

From GMpedia.org Wiki

Jump to: navigation, search

The following is a list of loops in Game Maker.

Contents

[edit] The Loops

[edit] do-until

The do-until loop repeats the <statement> until the <expression> is true. Each times it performs the <statement>, it then evaluates the <expression>, if it is true, it stops and moves to the next action, if it is false, the loop is repeated, then the statement is re-evaluated, and so on.

[edit] while

The while loop repeats the <statement> as long as the <expression> is true. Once the <expression> becomes false, the loop is stopped.

[edit] repeat

The repeat loop repeats the <statement> a constant number of times defined when the repeat loop is called.

[edit] for

The for loop defines a variable, does something to the variable on each repeat, and stops the loop when the variable reaches a defined value.

Personal tools