Repeat loop certain number of times

How would you go about having something loop through the draw loop a specific number of times? (Like a Scratch repeat 10 times loop.)

Hi @GordonBrune,

In GameLab, you would use the for loop to repeat something a given number of times. Here is the documentation on the for loop and here is a video that does a good job of explaining the three parts of the for loop. The video is covering App Lab but the description is still accurate in either.

Here is an example of a for loop in the draw loop and outside the draw loop. The pink circles run only one time because the for loop is before the drawLoop. The for loop with the yellow circles runs repeatedly with the drawLoop.

Hope that helps!
~Michelle

1 Like