AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

From steps to blocks

Week 2 · Unit 1: Be a game developer · 3 lessons
1

Break the task into parts

Computing 2: Unit 1, pp. 8–23
GoalBreak a task into smaller parts: a background, a character and an action.
New words
task · a job that you want to get donebackground · the picture behind the characterscharacter · a person or animal in a program
Explanation

Before we write code, we break the task into smaller parts. Here is a task: a duck spins when you tap it. Part 1 is the background. Part 2 is one character, the duck. Part 3 is one action, the spin. Small parts are easier to plan than one big job. Then we can write the algorithm.

1 background: a pond2 character: a duck3 action: spin
Worked examples
background: pondcharacter: frogaction: hop
Task: a frog hops across the screen. The parts are a pond background, one frog character and one action, which is hop.
Task: a bus drives along a road and says hello. This task has two actions: drive and say hello. We plan one action at a time and test each one.
A big game is made of many small parts, such as backgrounds, characters and actions. A programmer builds and tests one part at a time.
Class activity

Paper theatre: draw a background on a sheet of paper, for example a garden. Cut out one character from another piece of paper and write one action for it on a card, such as hop 3 or spin around. Slide the character over the background and act out the action. Swap with a friend. Can they say which part is the background, which is the character and which is the action?

Practice
1
A programmer wants a bird to fly to the right when you tap it. Name the background, the character and the action.
2
Task: a kite spins around in the sky. Which picture card is the background, which is the character and which is the action?
A the skyB the kiteC spin around
3
Why do programmers break a task into parts?
4
Look at the blocks for a cat. How many actions does the cat do?
2