Intermediate Scratch – Challenge 12 – 2-Player Network Guessing Game


This week in CoderDojo Athenry, we continued to play with networking in Scratch.

As we learned last week, you can set up a Mesh network in Scratch so that Scratch programs running on two different computers can exchange information with each other. This week, we used those ideas in combination with our simple guessing game from Challenge 2, to create a 2-player network guessing game.

Since we have new members who have just joined us in the past week, they could focus on the one-player version while more experienced members could work on the networking aspect.

The big ideas behind this challenge were:

  1. Design of a 2-player game (need two programs with different roles and different code)
  2. Communications on the network using variables
  3. Broadcasts across the network
  4. Loops and Decisions: fundamental coding concepts

Here are my notes from the day (PDF format): CDA-S2-Challenge12-2Player-GuessingGame.pdf

Here are my versions of the game for both players:

  • GuessNumberNetwork: this is the one that plays the ‘guess a number game’ when the other one (the ‘boss’) chooses the number
  • GuessNumberNetwork-Boss: this is the one that allows you choose the number and then communicates with the other one that plays

Note that you must download these (they won’t run on the Scratch website) and enable Mesh networking as described in the notes for them to work.

If you would like a copy of my slides in PowerPoint format, get in touch via Twitter or the comments.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s