SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

8.03 Random balloons

With the code you have now, your balloon will always start in the same place and move in the same path.

Click the flag a few times to start your program, and you’ll see it’s the same every time.

Instead of using the same x and y position each time, you can let Scratch pick a random number instead. Change your balloon’s code, so that it looks like this:

balloon sprite

If you click the green flag a few times, you should notice that your balloon starts in a different place each time.

You could even use a random number to choose a random balloon colour each time:

red balloon sprite

What happens if this code is put at the start of your program? Does anything different happen if you put this code inside the forever loop? Which do you prefer?

×
×

Cart