Scratch Projects: Build a Game Step by Step
Scratch is a free, block-based programming tool made by MIT, where you snap coloured blocks together instead of typing code.
Parts of Scratch
- Sprites — the characters and objects you program
- Stage — where the action happens, with a backdrop
- Costumes — different pictures for a sprite, used for animation
- Scripts — stacks of blocks that give instructions
- Block categories: Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables
Project: Catch the Apples
Plan first. Decide the goal: catch falling apples in a bowl, scoring a point for each.
1. The bowl follows the mouse (input)
when green flag clicked
forever
go to mouse-pointer
2. The apple falls (repetition and movement)
when green flag clicked
set score to 0
go to x: (pick random -200 to 200) y: 180
forever
change y by -5
3. Catching an apple (selection and a variable)
forever
change y by -5
if touching Bowl then
change score by 1
go to x: (pick random -200 to 200) y: 180
4. Missing an apple (add a lives variable)
if y position < -170 then
change lives by -1
go to top again
When lives = 0, stop all.
Test and Debug
Play your game. Does the score go up? Does the apple restart? Fix any bugs, then ask a friend to play-test it and tell you what to improve.
Improve It
Add sounds, a second apple that is worth more points, a timer, and a backdrop. Make the game get faster as the score rises.
Remixing and Sharing
You can remix other people's shared projects, but always credit the original author. Never put personal information in a project you share.
Curriculum link: National Curriculum in England: Computing programmes of study (DfE) — Key Stage 2: design, write and debug programs that accomplish specific goals; use sequence, selection and repetition; work with variables and various forms of input and output