Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Map Class Reference
Map Class , Creates the map and controls collision between objects in the Breakout game. More...
#include <Map.h>
Public Member Functions | |
| Map () | |
| Stores the powerups in a vector. | |
| ~Map () | |
| Destructor. | |
| int | getCurrentLevel () |
| Gets the current level. | |
| bool | hasWon () |
| Checks if all levels are defeated. | |
| void | initBricks () |
| Get the level object based on the current level number and call initBricks() on it. | |
| void | update () |
| Updates the moving powerups on map. | |
| void | onBrickHit (const Brick &) |
| Creates powerUps depending on the PowerUpDropChancePct. | |
| void | drawMap (N5110 &lcd) |
| Draws all the bricks on the level, as well as powerUps. | |
| void | checkCollision (Ball &ball, Paddle &paddle) |
| Checks if brick <-> ball collided. | |
| void | resolveCollision (const Brick &brick, GameObject &obj) |
| Resolves the collision. | |
| bool | checkLevel () |
| Checks if we cleared the level and if we won. | |
| void | reset () |
| Resets the whole map when game is (re-)started. | |
| void | addBrick (Brick &brick) |
| Adds the brick to the vector. | |
Data Fields | |
| int | score |
| Stores the score of the game. | |
Detailed Description
Map Class , Creates the map and controls collision between objects in the Breakout game.
- Date:
- April 2019
Definition at line 162 of file Map.h.
Constructor & Destructor Documentation
Member Function Documentation
| bool checkLevel | ( | ) |
| void drawMap | ( | N5110 & | lcd ) |
| int getCurrentLevel | ( | ) |
| bool hasWon | ( | ) |
| void initBricks | ( | ) |
Get the level object based on the current level number and call initBricks() on it.
| void onBrickHit | ( | const Brick & | brick ) |
| void reset | ( | ) |
| void resolveCollision | ( | const Brick & | brick, |
| GameObject & | obj | ||
| ) |
Field Documentation
Generated on Thu Jul 14 2022 02:02:53 by
1.7.2