Following one action through the parts: tapping a game button

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Following one action through the parts: tapping a game button

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. You tap a button on a game screen. Which part first senses the tap?
A The touchscreen (input device)
B The storage drive
2. Which part decides what happens after you tap the jump button?
A The CPU
B The speaker
3. Where is the game kept while you are playing it?
A In RAM, so the CPU can reach it quickly
B Only inside the screen
4. Your game saves your high score so it is still there tomorrow. Which part keeps it?
A RAM
B Storage
5. After the CPU decides your character jumps, which part shows you the jump?
A The CPU
B The screen (output device)

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1tap = screen.sense() AThe CPU works out what the tap means and decides what the game should do next.
2result = cpu.decide(tap) Bstorage.save(score)
3RAM holds the running game and its current score while you play, so the CPU can reach them quickly. CThe screen only shows the result. Storage is the part that keeps the saved score.
4Storage keeps the saved score even after the device is turned off. Dram.hold(game)
5cpu.sense(tap) EThe touchscreen is the input device. It senses your finger tap on the game button.
6screen.save(score) FThe CPU does not sense taps. The touchscreen (input device) senses the tap, and then the CPU decides what to do with it.

Definitions

trace an action

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
Tap the game button The ______ senses the tap (input)
2.
Tap sensed The ___ decides what happens next
3.
Game is running ___ holds the game while you play
4.
Level finished _______ keeps the saved score
5.
Score changes The screen shows the result (______)

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A tap <- speaker.sense()
B action <- CPU.decide(tap)
C RAM.hold(game)
D storage.save(score)
E screen.show(action)
Question 2
A tap <- screen.sense()
B result <- CPU.decide(tap)
C CPU.hold(game)
D screen.show(result)
Question 3
A tap <- screen.sense()
B choice <- RAM.decide(tap)
C storage.save(score)
D screen.show(choice)
Question 4
A tap <- screen.sense()
B result <- CPU.decide(tap)
C RAM.hold(game)
D RAM.keep(saved_score)
E screen.show(result)
Question 5
A tap <- screen.sense()
B if tap = jump_button then
C screen.decide(jump)
D screen.show(jump)
E end if

Answer Key

Following one action through the parts: tapping a game button
Section A: Quick Questions
Q1
A — The touchscreen (input device)
Q2
A — The CPU
Q3
A — In RAM, so the CPU can reach it quickly
Q4
B — Storage
Q5
B — The screen (output device)
Section B: Match the Pairs
Q1
tap = screen.sense() → The touchscreen is the input device. It senses your finger tap on the game button.
Q2
result = cpu.decide(tap) → The CPU works out what the tap means and decides what the game should do next.
Q3
RAM holds the running game and its current score while you play, so the CPU can reach them quickly. → ram.hold(game)
Q4
Storage keeps the saved score even after the device is turned off. → storage.save(score)
Q5
cpu.sense(tap) → The CPU does not sense taps. The touchscreen (input device) senses the tap, and then the CPU decides what to do with it.
Q6
screen.save(score) → The screen only shows the result. Storage is the part that keeps the saved score.
Section C: Definitions
Q1
trace an action — Follow one action, like a game tap: the screen senses it, the CPU decides, RAM holds the game, storage keeps the saved score and the screen shows the result.
Section D: Fill in the Blanks
Q1
Tap the game button The screen senses the tap (input)
Q2
Tap sensed The CPU decides what happens next
Q3
Game is running RAM holds the game while you play
Q4
Level finished storage keeps the saved score
Q5
Score changes The screen shows the result (output)
Section E: Spot the Error
Q1
A — A speaker is an output device, so it cannot sense a tap. The touchscreen is the input device that senses it: tap <- screen.sense().
Q2
C — The CPU decides what happens, but it is RAM that holds the game while you play. The line should be RAM.hold(game).
Q3
B — RAM only holds things for now. The CPU is the part that decides what the tap does. It should be CPU.decide(tap).
Q4
D — RAM is temporary and forgets everything when the power goes off. A saved score is kept in storage, so it should be storage.save(score).
Q5
C — The screen shows results, it does not make decisions. The CPU decides that the character will jump: CPU.decide(jump).