Today you are coding in Scratch. You will build Shark Swim step by step at your device: a diver who swims a course, dodges a shark, and tries to reach the finish.
You can already move sprites and run a project. Today you will put movement, sensing and a win condition together into one chase game, and you will practise debugging when something does not behave as you expect.
Before you run anything, think: what do you expect to happen if the diver touches a wall or the shark?
Keep this short. Devices on Scratch, students logged in. Optional predict: before anyone runs code, ask what they think happens if the diver hits a wall or the shark, and park one or two answers to revisit in Make sense. Model only the opening setup on the board, then let pairs work. Do not list build steps here.
Welcome to the 'Shark Swim' game creation lesson! In this exciting lesson, you will learn how to create a fun game using Scratch. You will play as a diver who needs to swim through a course without touching the edges or getting caught by a shark. Sounds thrilling, right? Let's dive in and start creating!
Read the welcome aloud or let students skim it. Frame the lesson as a PRIMM code-along: predict where useful, run often, investigate, then modify. Remind them the goal is a working chase game plus at least one bug found and fixed. No code discussion yet.
Create a new Scratch project and delete the cat sprite.
Model creating a new project and removing the cat sprite on the board. Watch for students editing a shared or old project by mistake. Differentiation: pair less confident students with a partner who already knows the Scratch layout.
In the game a diver will swim through a course to try and reach the end without touching the edges or getting caught by the shark.
Paint a new backdrop with the following:
Model the backdrop briefly: blue fill, lane lines, green finish. Stress that line colour matters later for touching-colour sensing. Common bug: messy or wrong-colour lines. Cue students to keep lanes clear and use the same red and green you will sense. Support: show a simple three-lane sketch first.
Add the Diver1 sprite from the sprite library and then drag it to the start of your swim course.
Once you've positioned it at the start, add the following code to set it up for the start of the game.
when green flag clicked
set size to (40) %
go to x (-173) y (-138) // x and y of the start of your course
go to x y block does, it makes the sprite go to the coordinates.Model adding Diver1, placing it at the course start, and the green-flag setup (size and go to). Key question: why does go to matter when the green flag is clicked? Common bug: coordinates that do not match their painted start. Fix on the spot by reading x and y from the sprite position. Run once before adding movement.
You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.