Form 13: Variables and Conditionals in Games
Explore how variables and conditionals interact to track game values and control gameplay mechanics.
Questions
-
MultiChoice
What is a variable in programming?
-
MultiChoice
In a game, 'score = score + 10' when player catches coin. What is 'score'?
-
MultiChoice
'IF score >= 100 THEN print You Win!'. What triggers 'You Win!'?
-
WordsBox
A variable is used to store ____ like scores that can ____ during the game.
-
MultiChoice
In a game, lives = 3. Player hits obstacle: 'lives = lives - 1'. What is current lives?
-
MultiChoice
'IF lives == 0 THEN Game Over'. When is 'Game Over' displayed?
-
WordsBox
Conditionals check variable ____ to trigger game events like ____ or losing.
-
MultiChoice
Player collects speed power-up: 'speed = speed * 2'. If original speed was 5, new speed is:
-
MultiChoice
Which variable type is best for keeping track of whether a key was collected?
-
MultiChoice
'REPEAT UNTIL lives == 0: [Play game turn]'. When does game loop stop?
-
MultiChoice
What happens if a game fails to update the score variable when a target is hit?
-
MultiChoice
If coin_count = 5 and code runs 'coin_count = coin_count + 1', coin_count becomes: