The Scratch coding projects have proven to be a fabulous resource, especially since we moved to online coding workshops. They’ve been well received by teachers and students, and I’ve had plenty of opportunities to try them out with schools across South Wales.
This is the first in a series of reviews of Scratch coding projects from the Raspberry Pi website. How they work with a real class. The opportunities for challenge and tinkering and the obstacles we found along the way.
Henry VIII (Wikipedia)
Lots of Year 6 classes study the Tudors, particularly Henry VIII. At the start of Henry’s reign, many people were neglecting their archery practice due to the increasing popularity of ‘foot the ball’ or ‘kick ball’. In 1515, Henry passed a new law to try to maintain archery as the predominant sport in England. Male children over seven must have a bow, two arrows and be taught how to shoot or their parents would be fined. Interestingly, this law was never repealed and still exists today. Also, to encourage archery groups, Henry passed a law protecting them against prosecution should they accidentally shoot anyone unfortunate enough to be passing by. This was called the King’s Pardon.
The archery project is a great introduction to random numbers, broadcast blocks, and ‘if’ statements. The structure of the code is quite straightforward and repetitive enough for children to create an interesting game with a good degree of independence.
We always begin each project with a screenshot of the completed game and the questions, “What do you think this game does?” and “What do you want it to do?”. The first question encourages discussion and predicting the types of blocks needed to complete the project, and the second question gets creative ideas flowing for when it comes to ‘tinker time’.
At the beginning of the project, we discuss broadcast blocks and how they are used (it’s like the sprite is shouting a message that all the other sprites/backgrounds can hear). It’s a good idea to change the backdrop to the X-Y Background to discuss coordinates as this influences all aspects of position and movement.
When we want to move the arrow sprite randomly around the screen, we discuss the ‘pick random block’ and the children try to find it. Looking at the X-Y Background, we discuss the types of values they could include.
When the arrow sprite moves over the center of the target, we want to release the arrow and shoot towards the target. To do this, Scratch needs to respond to a key press. In the example, ‘space’ is used but we emphasise that any letter or number key could be used. Maybe an arrow key?
Once the key to fire the arrow is pressed, the arrow sprite shrinks in size to imitate moving towards the target. Here, we introduce ‘if’ statements to determine the colour the sprite is touching and ultimately, the score of that arrow.
The empty hexagon within an ‘if’ block is called a condition. If the condition is met, then Scratch runs the contents of the ‘if’ block. In this case, the condition is the colour yellow. The children are then free to choose the score that hitting this colour receives. At this point during ‘tinker time’, the children can add further sound effects. This could be a cheer, a thud, or any other type of effect. Liberal use of the microphone recording function often gives hilarious results!
With this basic structure in place, we discuss the purpose of each block in a script (a sequence of connected blocks) and then I challenge the children to create a script for the next colour on the target. I encourage them all to have a go but emphasise that they learn more from their mistakes than they do from getting it right. We try to make it fun and low stakes. Paired programming is fantastic at this point as children develop their communication and collaboration skills alongside their computational thinking skills.
Once they have a script for each of the colours on the board, the follow-along element of the project is complete. But we discuss what we could add to make the game even more interesting or exciting. As there is no endpoint to the game, we talk about adding a countdown timer and a score. These elements are easy to add and can be found in other projects. The benefit of adding these elements is they are a good introduction to variables and are quite straightforward for the children to understand. Before the children begin tinkering with their code, I always get them to click ‘save as a copy’. This allows them to refer back to the original correct code.
Some children also want to add music and further sound effects to their game. Such as a whoosh sound for the arrow. Or adding a moving sprite behind the board to try and put the player off.
This project provides insight into many elements of creating games and programming in Scratch, providing some scope to tinker. It links well to the Tudors topic and the code can form the base for any target-related game. Well worth a try and worth revisiting.
Next month, we’re going to have a boat race!
by Steve Lewis
Beat the Goalie is a great Scratch project that introduces students to sensing and broadcast blocks and shows how ‘if else’ statements are used to make decisions when a condition is met or not. It is a two-player game and provides scope for tinkering and adaptation. As with many projects on the Raspberry Pi website, Beat the Goalie provides a link to a starter project with the required sprites and background, allowing students to focus on developing their code.