Have you ever thought about how score is handled in video games? If you’ve ever played Pac-Man, you have certainly tried to get a high score. As you collect dots you get points—and bonus points for fruit. When the monsters turn blue, you try to get as many as you can as the score for each one increases and you eat your way through them. Many games have a scoring mechanism that is an integral part of the game.
Scores in games are handled with variables. A variable is set at the beginning of the game and changes throughout the game, based on actions that impact the score.
In this activity, you will set up a scoring system using variables. This is just one of many ways variables are used in programming.
Students will be able to:
- Demonstrate an understanding of variables as a concept.
- Apply the understanding of variables in the context of a game.
- Create a puzzle in a game environment that incorporates the use of variables.
Computer Science and Engineering
Grades 8 - 12 (Ages 13+)
Explore more lesson plans