New
New
Year 4

Modifying a game

I can modify an infinite loop in a given program.

New
New
Year 4

Modifying a game

I can modify an infinite loop in a given program.

These resources will be removed by end of Summer Term 2025.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

These resources were created for remote use during the pandemic and are not designed for classroom teaching.

Lesson details

Key learning points

  1. An infinite loop can be modified.
  2. Changing values within loops can affect how the game plays.
  3. Existing code can be reused and modified for new sprites.

Keywords

  • Decompose - to break down a task into smaller, more achievable steps

  • Modify - to make changes to something

  • Predict - to say what you think will happen before it happens, based on what you already know or can see

Common misconception

Using a 'repeat 1000' block is just the same as using a 'forever' block to make a character keep doing something in a game.

Even though a repeat 1000 runs many times, a forever loop runs without an end point, which is better for actions that need to continue through the entire game.


To help you plan your year 4 computing lesson on: Modifying a game, download all teaching resources for free and adapt to suit your pupils' needs...

This lesson focuses on repetition, where actions or commands in programming are repeated using loops. Loops can be repeated without an end, and these are known as ‘infinite loops’. Loops can also run for a set number of times, and these are known as ‘count-controlled loops’.
Teacher tip

Equipment

Licence

This content is © Oak National Academy Limited (2025), licensed on Open Government Licence version 3.0 except where otherwise stated. See Oak's terms & conditions (Collection 2).

Lesson video

Loading...

Prior knowledge starter quiz

Download quiz pdf

6 Questions

Q1.
What does an event block like the green flag do in a coding project?
It deletes sprites
Correct answer: It starts one or more processes
It changes the background
It saves the project
Q2.
What can repetition be used for in a sprite’s animation?
Correct answer: To change the sprite’s costumes repeatedly
To make the sprite disappear
To make the sprite stop moving
To delete the sprite
Q3.
If you want to copy a part of your coding project exactly, what should you do?
Move it
Animate it
Evaluate it
Correct answer: Duplicate it
Q4.
What do we call a set of clear steps to solve a problem?
Correct Answer: Algorithm
Q5.
Put these actions in order for evaluating a coding project:
1 - Look at how it works
2 - Test the project
3 - Write down what can be improved
4 - Make changes if needed
Q6.
Match the process to its effect:
Correct Answer:Using a loop,Repeats actions

Repeats actions

Correct Answer:Changing costumes,Animates the sprite

Animates the sprite

Correct Answer:Clicking the green flag,Starts the program

Starts the program

Correct Answer:Duplicating a sprite,Makes an exact copy

Makes an exact copy

Assessment exit quiz

Download quiz pdf

6 Questions

Q1.
Which block will keep a character moving for the entire game?
Repeat 10
Repeat 1000
Wait
Correct answer: Forever
Q2.
What happens if you use a 'repeat 1000' block instead of a 'forever' block?
The action never stops
The action only happens once
The block disappears
Correct answer: The action happens 1000 times then stops
Q3.
What is it called when you break a task into smaller steps?
Correct Answer: Decompose, decomposition
Q4.
Which of these is a good reason to decompose a large coding project?
Correct answer: To break it into easier parts
To make it harder
To make it longer
To confuse others
Q5.
Arrange these actions for reusing code for a new sprite:
1 - Select the code you want to copy
2 - Paste the code into the new sprite
3 - Modify the code to fit the new sprite
4 - Test it works correctly
Q6.
Match the keyword to its definition:
Correct Answer:Decompose,Break into smaller steps

Break into smaller steps

Correct Answer:Modify,Make changes

Make changes

Correct Answer:Predict,Say what you think will happen

Say what you think will happen

Correct Answer:Reuse,Use something again

Use something again

Additional material

Download additional material