Trouble with 'while' loops

Whenever I try to use a ‘while’ loop in my projects, the simulator just displays a blank screen no matter what other code I have. Even if the loop doesn’t contain any code, this still happens. Does anyone have some insights?

Call pause(0); (any integer time works, even 0, but it obviously won’t have a delay of 0) so Arcade has a chance to redraw the screen, etc.

Also don’t forget to break out of the while loop eventually, either by using a condition in the while loop, or use the break; statement.

2 Likes

I was about to say that too, while loops go on forever if you don’t implement a way to stop.