Assignment 19 - Bugstomp Game
Example Output
Learning Outcomes
- Loops
- 2D Arrays
- Conditional Statements
Goals
The purpose of this assignment is to learn to
- Move a character sprite around a 2D grid to step on randomly generated bug sprites.
- Use loops, 2D arrays, and conditional statements to move the character and check if he has stepped on a bug sprite.
Description
Tasks
- Initialize a 2D array the size of your game grid.
- Initialize the NamedColors of your character, bugs, and background.
- Determine the starting point of your character on the grid.
- Create a function that uses keypress events to move the character around.
- Create a function that will generate bugs in a random place on your grid.
- Create a function that will check if the character has collided with a bug.
- Create a function that removes bugs after some amount of time.
- Create a win condition.
More Details to Get You Started
Key Press Events - NonBlocking Games
- keyUp()
- keyDown()
- keyLeft()
- keyRight()
- keyQ()
- keySpace()
- keyW()
- keyS()
- keyA()
- keyD()
Variables, Colors, and Sprite Symbols
- NamedSymbol.symbolname;
- NamedColor.colorname;
- drawSymbol(column, row, NamedSymbol, NamedColor);
- setBGColor(column, row, NamedColor);
Important Functions
- The gameLoop() function loops until the game is over.
- quit() stops the game.
- start() starts the game and calls the initialize() function once before it starts the gameLoop() function.
- render() sends your updated game grid to the server once. This is a blocking game function.
Extensions
Help
For Java
NonBlockingGame documentation
NamedColor Documentation
NamedSymbol Documentation
For C++
NonBlockingGame documentation
NamedColor Documentation
NamedSymbol Documentation
For Python
NonBlockingGame documentation
NamedColor Documentation
NamedSymbol Documentation