Why is my while loop freezing thegame?

im trying to make it so a sprite gets bigger in size as it goes and im trying to use a while not loop but it just freezes my game before anything happens

WHAT did i do wrong

2 Likes

Well because nothing in the loop does anything with the variable, it will repeat infinitely. Youre kinda just asking makecode to scale the sprite infinite times in a single frame. You need to set the variable to 0 somewhere in the while loop or use the break block.

3 Likes

If your gonna finish this demake then feel free to use sprites or code from my own:

1 Like

ok i put a pause block in the loop and its working now

Because while loops run in the main loop, it will pause your other code until the current iteration is finished. (I think that’s why)

What @Soleb244 said, or you could use a pause block somewhere in the while loop to let other code run and potentially stop the while loop from outside of it.

1 Like

Nevermind turns out I’m an absolute idiot

1 Like

No your not! dont say that about yourself! You just wrote read it wrong, dont call yourself an idiot. its not nice.

2 Likes

can we delete this topic already