Computer Science Grade 3 20 min

Game Rules: Setting the Boundaries

Students will establish rules and constraints for their games.

Tutorial Preview

1

Introduction & Learning Objectives

Learning Objectives Identify the rules in a simple game. Define a 'rule' and a 'boundary' in the context of game design. Explain how 'If...Then...' statements create game rules. Create a simple rule for a game character, like collecting an item. Design a rule that stops a character from moving through a wall. Describe how rules affect game data like score or lives. Have you ever played a game and wondered why you can't just walk through walls or jump to the moon? 🚀 It's because of rules! Today, we're going to be game architects! We will learn how to create game rules that set the boundaries for our players. These rules tell the computer what can and can't happen in our game world, making it fun and fair. Real-World Applica...
2

Key Concepts & Vocabulary

TermDefinitionExample RuleAn instruction that tells the game what to do when something specific happens.A rule could be: 'If the player touches a coin, add 1 to the score.' BoundaryAn invisible wall or edge that stops players or objects from leaving the game area.The edges of the screen in a platformer game are boundaries that you can't walk past. ConditionThe 'If' part of a rule. It's something the computer checks to see if it's true.In the rule 'If the player has a key, then open the door,' the condition is 'If the player has a key.' ActionThe 'Then' part of a rule. It's what happens when the condition is true.In the rule 'If the player touches lava, then lose a life,' the action is 'then lose a life.&#...
3

Core Syntax & Patterns

The 'If...Then...' Rule (Conditional) IF [a condition is true], THEN [do an action]. This is the most important pattern for making game rules. The computer checks the 'IF' part. If it's true, the computer follows the 'THEN' instruction. The 'When...Do...' Rule (Event) WHEN [an event happens], DO [an action]. This pattern is great for things the player does. It tells the computer to wait for a specific event (like a mouse click) and then perform an action. The 'Change Data' Rule SET [data] to [value] OR CHANGE [data] by [value]. Use this to change numbers in your game. You can set a score to 0 at the start, or change the score by +1 when a coin is collected.

4 more steps in this tutorial

Sign up free to access the complete tutorial with worked examples and practice.

Sign Up Free to Continue

Sample Practice Questions

Challenging
You are designing a cooperative game where two players must help each other. Which rule would BEST encourage teamwork?
A.The first player to reach the end wins the game.
B.Players lose points if they bump into each other.
C.Player 1 can walk through red doors but not blue doors, and Player 2 can walk through blue doors but not red ones.
D.The player who collects the most coins is the winner.
Challenging
A game is unbalanced because the 'Lightning Shoes' make one player too fast. What is the BEST rule change to make the game more fair without removing the shoes completely?
A.Make the shoes even faster to make them more exciting.
B.Give every single player Lightning Shoes at the start.
C.Change the color of the Lightning Shoes to red.
D.Make the Lightning Shoes a power-up that only works for 15 seconds.
Challenging
In your game, the rule is `WHEN player touches monster, player loses life`. But when you test the game, you lose a life even when you are far away from the monster. What is the most likely bug with the rule's boundary?
A.The monster's 'touch' area, or hitbox, is accidentally set to be way too big.
B.The monster is moving too fast for the player to see.
C.The player has too few lives to start with.
D.The monster is the wrong color and is hard to see.

Want to practice and check your answers?

Sign up to access all questions with instant feedback, explanations, and progress tracking.

Start Practicing Free

More from Game Design Galaxy: Creating Interactive Worlds

Ready to find your learning gaps?

Take a free diagnostic test and get a personalized learning plan in minutes.