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.
Game/Game.h@12:5549a299d41e, 2019-05-06 (annotated)
- Committer:
- joshdavy
- Date:
- Mon May 06 14:52:05 2019 +0000
- Revision:
- 12:5549a299d41e
- Parent:
- 11:db27d3838514
test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joshdavy | 11:db27d3838514 | 1 | #ifndef GAME_H |
joshdavy | 1:37802772843e | 2 | #define GAME_H |
joshdavy | 1:37802772843e | 3 | |
joshdavy | 1:37802772843e | 4 | /*Game Class*/ |
joshdavy | 1:37802772843e | 5 | #include "mbed.h" |
joshdavy | 1:37802772843e | 6 | #include "N5110.h" |
joshdavy | 1:37802772843e | 7 | #include "Gamepad.h" |
joshdavy | 1:37802772843e | 8 | #include "Sprite.h" |
joshdavy | 3:b34685dbdb8d | 9 | #include "Player.h" |
joshdavy | 6:2ca1516ec1e2 | 10 | #include "Level.h" |
joshdavy | 11:db27d3838514 | 11 | |
joshdavy | 1:37802772843e | 12 | |
joshdavy | 12:5549a299d41e | 13 | /** Game Class |
joshdavy | 2:b62e8be35a5d | 14 | |
joshdavy | 12:5549a299d41e | 15 | @brief Class for the main game. Responsible for level loading, updating and |
joshdavy | 12:5549a299d41e | 16 | drawing the game screen. |
joshdavy | 12:5549a299d41e | 17 | |
joshdavy | 12:5549a299d41e | 18 | @version 1.0 |
joshdavy | 12:5549a299d41e | 19 | |
joshdavy | 12:5549a299d41e | 20 | @author Joshua Davy el17jd |
joshdavy | 12:5549a299d41e | 21 | |
joshdavy | 12:5549a299d41e | 22 | @date April 2019 |
joshdavy | 12:5549a299d41e | 23 | |
joshdavy | 12:5549a299d41e | 24 | */ |
joshdavy | 2:b62e8be35a5d | 25 | |
joshdavy | 1:37802772843e | 26 | class Game { |
joshdavy | 1:37802772843e | 27 | |
joshdavy | 1:37802772843e | 28 | public: |
joshdavy | 1:37802772843e | 29 | Game(); |
joshdavy | 1:37802772843e | 30 | ~Game(); |
joshdavy | 7:68e06dda79f7 | 31 | void init(); |
joshdavy | 1:37802772843e | 32 | void update(Gamepad &pad); |
joshdavy | 11:db27d3838514 | 33 | void draw(N5110 &lcd); |
joshdavy | 9:96969b1c6bde | 34 | bool game_won(); |
joshdavy | 1:37802772843e | 35 | |
joshdavy | 1:37802772843e | 36 | private: |
joshdavy | 11:db27d3838514 | 37 | void load_level(int level_number); |
joshdavy | 11:db27d3838514 | 38 | |
joshdavy | 3:b34685dbdb8d | 39 | Player _player; |
joshdavy | 6:2ca1516ec1e2 | 40 | Level _level; |
joshdavy | 9:96969b1c6bde | 41 | int _current_level; |
joshdavy | 9:96969b1c6bde | 42 | bool _game_won; |
joshdavy | 1:37802772843e | 43 | }; |
joshdavy | 1:37802772843e | 44 | #endif |