Lesson plan 8 of 12

Loops. Make waves.

On the board: "a ship that shoots asteroids that come in waves". A loop does the same thing again and again. The game spawns one bad thing with a loop that runs waveSize times. Change the number, change the wave.

0 min: The code on the board

Put the class code on the projector (Teach, then Projector). Children open codeitlearn.com/join, type the code and a first name. Five minutes, no accounts.

5 min: Say a game

Write on the board: "a ship that shoots asteroids that come in waves". Everyone types it, or their own version of it, on Build and presses Build it. Walk the room. By minute ten every child has a game playing.

12 min: The projector fills

Open the projector. Tiles appear as games are published. Press one; it plays on the big screen. Two minutes of this is the reward for the room and the reason the next part works.

15 min: The power: Loops

Everyone opens Powers and presses Loops. Read the first line aloud: "A loop does the same thing again and again. The game spawns one bad thing with a loop that runs waveSize times. Change the number, change the wave." Step one changes one line and runs it; step two changes it again; the check is them writing it with the highlight gone. Three minutes for most, ten for some.

30 min: Build with it

Back to Build, with the power switched on in their game. Ask for a new sentence that uses it: a ship that shoots asteroids that come in waves. Publish. The projector shows the new ones.

40 min: Show two

Press two tiles on the projector. Ask each child what they changed. The sentence they say back is the assessment.

What to look for

Ask how many bad things one wave brings now, and where the number is written.

Previous: If, then. React to things. · Next: Timers. Change things over time. · All twelve lesson plans

Before the lesson

Make a class on CodeIt and put its code on the projector. Children join at codeitlearn.com/join with the code and a first name. Classes are free.