Automated systems in gaming

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

Automated systems in gaming

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A motion controller is swung like a tennis racket. Which sensor detects the movement?
A Accelerometer
B Humidity sensor
2. In a games console, which part processes the sensor readings from a controller?
A Actuator
B Microprocessor
3. A controller buzzes when the player's car hits a wall. Which part of the system is the vibration motor?
A Actuator
B Sensor
4. A VR headset turns the view when the player turns their head. What happens first?
A The screen changes and then the sensors detect the movement
B Sensors detect the head movement and send readings to the microprocessor
5. Which pair of sensors could track where a player is standing in front of a game camera?
A Infra-red and proximity sensors
B pH and gas sensors

Match the Pairs

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

Left columnRight column
1IF acceleration > 8 THEN SWING_SWORD AIF head_turn = LEFT THEN VIEW ← LEFT
2IF hit = TRUE THEN VIBRATE(1) Bpos ← READ_IR() MOVE_AVATAR(pos)
3A VR headset responds to head movement by changing the view the player sees CThe headset sensor must not control the screen directly. Its reading goes to the microprocessor, which processes it and then changes the view.
4An infra-red sensor tracks where the player is so the game can move their on-screen character DA vibration motor is an actuator (an output device), so the microprocessor cannot read from it like a sensor. It should switch it on with something like VIBRATE(1).
5pressure ← READ(vibration_motor) EWhen the game detects a hit, the microprocessor switches on the vibration motor so the player feels it
6SCREEN ← head_sensor FA fast movement of the motion controller makes the character swing a sword in the game

Definitions

gaming automated system

Fill in the Blanks

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

1.
shake ← READ(_____________) IF shake > 8 THEN OUTPUT "Sword swing"
2.
dist ← READ(proximity) IF dist _ 1 THEN OUTPUT "Move back"
3.
IF hit = TRUE THEN SET motor ← __ ENDIF
4.
IF head = "left" ____ view ← "turn left" ENDIF
5.
player ← READ(infrared) IF ______ = "left" THEN OUTPUT "Move view left"

Spot the Error

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

Question 1
A WHILE game_running = TRUE
B tilt ← READ_ACCELEROMETER()
C CALL steer_car(speed)
D ENDWHILE
Question 2
A WHILE headset_on = TRUE
B head ← READ_MOTION_SENSOR()
C turn ← head - last_head
D CALL vibrate(turn)
E ENDWHILE
Question 3
A damage ← GET_HIT_STATUS()
B IF damage ← TRUE THEN
C vibration_motor ← ON
D ENDIF
Question 4
A player_x ← VIBRATE()
B character_x ← player_x
C CALL draw_character()
Question 5
A dist ← READ_PROXIMITY()
B warn ← FALSE
C IF dist > 50 THEN
D warn ← TRUE
E ENDIF

Answer Key

Automated systems in gaming
Section A: Quick Questions
Q1
A — Accelerometer
Q2
B — Microprocessor
Q3
A — Actuator
Q4
B — Sensors detect the head movement and send readings to the microprocessor
Q5
A — Infra-red and proximity sensors
Section B: Match the Pairs
Q1
IF acceleration > 8 THEN SWING_SWORD → A fast movement of the motion controller makes the character swing a sword in the game
Q2
IF hit = TRUE THEN VIBRATE(1) → When the game detects a hit, the microprocessor switches on the vibration motor so the player feels it
Q3
A VR headset responds to head movement by changing the view the player sees → IF head_turn = LEFT THEN VIEW ← LEFT
Q4
An infra-red sensor tracks where the player is so the game can move their on-screen character → pos ← READ_IR() MOVE_AVATAR(pos)
Q5
pressure ← READ(vibration_motor) → A vibration motor is an actuator (an output device), so the microprocessor cannot read from it like a sensor. It should switch it on with something like VIBRATE(1).
Q6
SCREEN ← head_sensor → The headset sensor must not control the screen directly. Its reading goes to the microprocessor, which processes it and then changes the view.
Section C: Definitions
Q1
gaming automated system — Sensors in a controller or headset send readings to a microprocessor, which changes what the player sees or feels, such as moving the view or making the controller vibrate.
Section D: Fill in the Blanks
Q1
shake ← READ(accelerometer) IF shake > 8 THEN OUTPUT "Sword swing"
Q2
dist ← READ(proximity) IF dist < 1 THEN OUTPUT "Move back"
Q3
IF hit = TRUE THEN SET motor ← ON ENDIF
Q4
IF head = "left" THEN view ← "turn left" ENDIF
Q5
player ← READ(infrared) IF player = "left" THEN OUTPUT "Move view left"
Section E: Spot the Error
Q1
C — The variable speed was never created. The accelerometer reading is stored in tilt, so the steering call must use CALL steer_car(tilt).
Q2
D — When the player turns their head in a VR headset, the picture must move. It should be CALL move_view(turn), not the vibration motor.
Q3
B — An IF condition must compare values using =. The arrow ← is for assigning a value, so the line should be IF damage = TRUE THEN.
Q4
A — The player's position is tracked by an input sensor. A vibration motor is an output device, so the line should read from the infra-red sensor: READ_INFRARED().
Q5
C — The warning should appear when the player is too close to the wall. The proximity reading must be less than 50, so the test is dist < 50.