Session 1: Coach notes

Goal of this session

At the end of the Basic checkpoint a ninja can:

  • Move the basket left and right with the arrow keys.
  • See a star fall from the top of the screen to the bottom.
  • Read the update() function, understand what it says, and make a small change of their own (for example raise the speed).

What is not expected after session 1: keeping score, collision detection, random start positions. Those come in session 2.

Success looks modest: the ninja has the game running, understands the structure of the code, and is keen to carry on next time.


Preparation (30 min before the session)

  • Portable Thonny on a USB stick: essential for laptops without admin rights. Get it ready so you don’t have to hunt for it when you need it.
  • Test the projector: check the connection, the resolution, is there an HDMI cable? Test this before the ninjas come in.
  • Starter ZIP ready in two places: a shared USB stick and the site (/sessions/python/01-catch-the-stars/starter.en.zip). Wifi can be slow; USB is the safest fallback.
  • Run the starter once yourself on the dojo room laptop: that way you know whether pgzero is installed correctly there and there are no surprises.

⚠️ Risk: this is the entry session

This is the session with the highest risk of technical problems. Expect install problems on about 30% of the laptops. That is normal and no reason to panic.

Mitigations:

  • Pair programming where the install fails: let two ninjas share one laptop. This works surprisingly well and gets them working together.
  • Portable Thonny on USB as a fallback: no admin rights needed.
  • Time limit for install triage: 15 minutes in total. After that you pair up everyone who isn’t running yet with someone who is, and you move on. Don’t let install problems slow down the whole group.
  • Pgzero via Thonny: Tools → Manage packages → search pygame-ce → install, then pgzero. This takes 1-2 minutes, but can hang on slow wifi. Have a USB version at hand as an alternative. Does the pgzero install get stuck on Python 3.14 or 3.15? Then use the one-click install script or set Thonny to Python 3.13 (see Installing Thonny).

Schedule (3 hours)

TimeActivity
0:00 to 0:15Welcome, learning names, explaining what CoderDojo is
0:15 to 0:30Projector: explaining Pgzero and the starter code
0:30 to 2:00Working on your own: checkpoints step 1→2→3→4
2:00 to 2:30Buffer / stretch / expert + walking around
2:30 to 2:45Showcase: everyone shows what they made
2:45 to 3:00Cliffhanger + handing out take-home + tidying up

The buffer block (2:00 to 2:30) is deliberately wide. Use it for ninjas who are stuck, for stretch challenges, or to help one on one. Walk around actively during this block. Don’t wait until someone puts their finger up.


Common questions

“My window opens and closes straight away” WIDTH and HEIGHT aren’t at the top of the file, or have accidentally been deleted. Ask the ninja to look at the top lines of the starter code and check whether the variables are there.

“The basket goes through the edge” Good spot! This isn’t a bug you need to fix now. This is a challenge. Ask: “How could you stop the basket from going off the screen?” Hint: look at the value of basket.x and compare it with 0 and WIDTH. Example: if basket.x > 20.

“I’ve made everything already, what now?” Point the ninja to the take-home extensions on the session page, or ask them to help a buddy. Coaches can also give a stretch challenge verbally.

“Pgzrun: command not found” Restarting Thonny after installing pgzero usually fixes this. If that doesn’t help, use portable Thonny from the USB stick.


Hints for Stretch and Expert

Give hints, not full code. The ninja has to work it out themselves. If someone is really stuck after several hints, you can point them to solution/main.py for the complete answer.

Stretch: collision star.colliderect(basket) returns True when the two rectangles overlap. Reset star.y = 0 both on a collision and when star.y > HEIGHT, so the star starts falling again.

Expert: score Declare global score at the top of update() before you change score, otherwise Python gives an UnboundLocalError. Put screen.draw.text(f"Score: {score}", ...) in draw(), not in update(). The draw() function is called every frame and is the right place for anything that appears on the screen.


Cliffhanger script

Read this out to the group at the end of the session:

“Today you caught stars. Next time there are things that FIGHT BACK. We blow them up, with REAL SOUND. And you get your own spaceship.”


No Dojo Defender today

Session 1 deliberately focuses on one thing: getting the first game running and understanding it. Dojo Defender, the bigger project that ninjas build up through the year, only starts in session 2. Don’t introduce it today.

If a ninja asks about Dojo Defender: “Next month. Today we focus on the basics.”

This is a deliberate choice: two codebases on day one is too much. The focus on Catch the Stars gives ninjas a success experience without overwhelming them.


Pilot findings

(To be filled in after the pilot (Task 20).)