Loops & Animation 🔁
beginner20 XP

Repeat & Forever

Spin a wind turbine with loops.

Repeat & Forever 🔁

What if you want to do something again and again? Use a loop! Loops are orange Control blocks.

Repeat a few times

when flag clicked
repeat (4)
  move (50) steps
  turn right (90) degrees
end

The blocks inside the repeat block happen 4 times. The sprite walks in a square! ⬜

Forever means... forever!

when flag clicked
forever
  turn right (5) degrees
end

This spins and spins until you click the 🛑 stop sign.

🌬️ A wind turbine

Wind turbines spin in the wind and make clean electricity, with no smoke! Let's make one:

when flag clicked
forever
  turn right (10) degrees
  wait (0.05) seconds
end

🛠️ Build it!

  1. Click Paint 🖌️ to draw a turbine: 3 long blades from the middle, like a ✳️ star.
  2. Build the turbine script.
  3. Click the 🟢 flag. Wheee!

⭐ Bonus: make the turbine spin faster. Which number should you change?

💨 Fun fact

One big wind turbine can make enough electricity for hundreds of homes!

🛠️

Build it in Scratch!

Open Scratch in a new tab, find the blocks shown above (they're the same colors!), snap them together and click the green flag. Then try the challenge ideas in the lesson.

Open Scratch ↗

Scratch is free and made by MIT for kids. You can build without an account. To keep a project, ask a grown-up to help you sign in, or use File → Save to your computer.

Quick check

01/5
How many times does the sprite move?
repeat (3)
move (10) steps
end