Fastloop

From Mario Fan Games Galaxy Wiki
 Stub.png This article or section is in need of expansion.

Please add further information.

Fastloops are Click loops similar to other languages' for or repeat loops, and allow a certain group of actions to run an arbitrary number of times. A fastloop takes two parameters, a name (string) and how many times it should run (integer). Fastloops' indexes always start at 0, and they always increment by 1. Running a loop a negative number of times will therefore cause the application to freeze, unless other events cause the loop to stop.

Fastloops are almost required for many types of things, such as engines. As the screen is not refreshed until after the loop is completed (because the loop pauses the entire event list), only the result of the very last iteration will generally be seen. Fastloops are also required for avoiding many problems encountered with object selection

Fastloops can be nested, which makes things like arranging objects in a grid much easier than other methods. However, nesting can result in a large number of running loops, which can slow down if not temporarily pause the app.

Though TGF/MMF lack other loop types (while, etc), they can be emulated with fastloops:

While loop

[loop-starting condition]
--> Start Loop: "While"; -1

On loop "While"
+ [some condition]
--> [action]

On loop "While"
+ [same condition as above, but with opposite comparison operator]
--> Stop loop: "While"