Skip to content
Menu

Year 5 (ages 9–10, Grade 4 in the US) · Computing · Selection · Lesson 3

Selection in games

Using selection with sensing conditions (key pressed, touching, touching colour) inside forever loops to build and debug a simple collecting game.

Exam boards: this lesson matches the AQA and Pearson Edexcel GCSE computing courses. Check which course your school follows.

Whiteboard video lesson: Selection in games

14-minute video lesson

Teaching, worked examples and 20 practice questions solved step by step.

Watch free for a month

What your child will learn

  • Use sensing conditions
  • Combine if with forever
  • Use a score variable
  • Debug game rules

The method

  1. Rule.
  2. Sensing.
  3. In forever.
  4. Test.

Key words: sensing, selection, forever, variable, touching, debug.

Worked examples

Worked examples from the lesson, with every step.

Question 1

Which condition checks if a key is pressed?

  1. Step 1: key pressed?

Answer: key ___ pressed?

Question 2

Which condition checks if two sprites meet?

  1. Step 1: touching

Answer: touching ___ ?

Question 3

In the game, what moves the player right?

  1. Step 1: right arrow

Answer: pressing the right arrow (change x by 10)