Welcome to Year 3 Computing — Scratch Lesson 3: Sensing Objects & Variables! 👻❤️
You have an awesome maze and a moving character! But wait… your character can walk straight through the walls! Today, we will use Selection to make our Sprite sense the walls, and Variables to give our character 3 lives!
Target Standards:
- CSTA 1B-AP-09: Create programs that use variables to store and modify data.
- UK National Curriculum: Use selection and variables in programs.
Step 1: Keyboard Warm-up ⌨️ (10 Mins)
- Click here to warm up your fingers: Start Typing Practice on Ndovu.
- Today’s keywords: sensing, selection, variable, modify, data, loop.
Step 2: Teaching the Sprite to Sense Walls 🎬 (15 Mins)
Watch this video to learn how to lock your sprite to a starting position and use an If/Then block to sense the colour of your maze walls. If your sprite touches the wall, it will be sent right back to the start!
Step 3: Creating a “Lives” Variable & Game Over ❤️ (15 Mins)
Right now, your sprite gets sent back to the start, but nothing else happens. Let’s make it a real game by adding Lives! Watch the video below to learn how to create a Variable that counts down, and how to hide your Sprite when lives run out.
- Go to the dark orange Variables menu and click Make a Variable. Type Lives and click OK.
- Drag the
set [Lives] to 3block and snap it right under your Green Flag (before the forever loop) so you start with 3 lives. - Drag the
change [Lives] by 1block and drop it inside yourif touching colorblock. Change the 1 to -1 so your sprite loses a life! - To make a Game Over screen, use another green flag and a
foreverloop. Add anif < [Lives] < 1 > thenblock from the green Operators menu. If lives are less than 1, tell the Sprite to hide! (Don’t forget to put a show block under your main start flag so it comes back next game).
Step 4: Plenary & Reflection 👋 (10 Mins)
Let’s share some of the bugs and struggles we overcame today so we can help each other become better coders. Once we have discussed our work, fill out the reflection tool below to save your certificate!

Comments are closed, but trackbacks and pingbacks are open.