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.
Dependencies: mbed
Fork of el17dg by
game/game.h@26:676874c42883, 2019-04-06 (annotated)
- Committer:
- Noximilien
- Date:
- Sat Apr 06 20:13:33 2019 +0000
- Revision:
- 26:676874c42883
- Parent:
- 25:749f1efc31fc
- Child:
- 27:f05f4e738ba9
I have created a difficulty feature based on the in-game score. As the score gets higher, so does the game. Have added more comments. Started cleaning up the code and simplify it.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Noximilien | 3:10918b0f7a7d | 1 | #ifndef GAME_H |
Noximilien | 3:10918b0f7a7d | 2 | #define GAME_H |
Noximilien | 3:10918b0f7a7d | 3 | |
Noximilien | 21:0eb394495b8a | 4 | #include "geometry.h" |
Noximilien | 25:749f1efc31fc | 5 | extern int game_score; |
Noximilien | 26:676874c42883 | 6 | extern int score_count_for_difficulty; |
Noximilien | 25:749f1efc31fc | 7 | extern int player_lifes; |
Noximilien | 25:749f1efc31fc | 8 | extern bool red_led_state; |
Noximilien | 26:676874c42883 | 9 | extern bool game_over; |
Noximilien | 25:749f1efc31fc | 10 | extern int red_led_flashing; |
Noximilien | 24:0570cb4b92d7 | 11 | |
Noximilien | 4:02c63aaa2df9 | 12 | class Game{ |
Noximilien | 4:02c63aaa2df9 | 13 | public: |
Noximilien | 4:02c63aaa2df9 | 14 | bool updateAndDraw(); |
Noximilien | 21:0eb394495b8a | 15 | void startNewGame(); |
Noximilien | 4:02c63aaa2df9 | 16 | private: |
Noximilien | 21:0eb394495b8a | 17 | void collideEnemiesAndBlasts(); |
Noximilien | 21:0eb394495b8a | 18 | void collideEnemiesBlastsAndPlayer(); |
Noximilien | 23:240bc00ef25b | 19 | void collideEnemiesAndPlayer(); |
Noximilien | 26:676874c42883 | 20 | void starsSpawnDelay(); |
Noximilien | 26:676874c42883 | 21 | void increaseGameDifficultyAndEnemySpawnDelay(); |
Noximilien | 23:240bc00ef25b | 22 | void gameOver(); |
Noximilien | 3:10918b0f7a7d | 23 | }; |
Noximilien | 3:10918b0f7a7d | 24 | |
Noximilien | 3:10918b0f7a7d | 25 | |
Noximilien | 3:10918b0f7a7d | 26 | #endif |