Ah, loops, so useful, so many! Here I will show you how to use different loops. Now lets go over the types:
Lets start now!
Ok I DONT recomend this one, it is less efficient, but that doesnt really matter now. You can have a loop that looks like this:
Thats basically it, but this is not a recommended loop.
Yes, a repeat loop. This one is basically (bad pun) a loop that repeats until the specified condition(s) is/are satisfied. Ex:
UNTIL 'Condition that should be satisfied
So theres that.
This is basically (again) the repeat loop reversed, while a condition is satisfied, it loops. Here is an example:
WHILE 'Conition that is satisfied
so thats that.
This one is kinda useful, like for loading maps, but basically (AGAIN) is a loop where a variable is equal to a value and the loop repeats until the variable is equal to an other value. I dont think you can change the value while its looping, but when it loops the value increases/decreases depending on if the value is bigger or smaller than the other value until it is equal to the other value. it then stops looping and the value is still equal to the second value. Also if you put STEP then a number, it will change the amount that the variable is changing by, by the number after step.
FOR I=0 TO 3
FOR I=0 TO 4 STEP 2
WENDAlso with the while/repeat loops u can do this for infinint looping. remember they are different: