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
main.cpp@17:cb39d9fa08dc, 2019-04-27 (annotated)
- Committer:
- el17mcd
- Date:
- Sat Apr 27 17:43:46 2019 +0000
- Revision:
- 17:cb39d9fa08dc
- Parent:
- 16:a2c945279b79
- Child:
- 19:1c3ff2d748ae
! Stylistic changes made to code so it conforms to google c++ guide. Beginning of inline commenting of source code.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17mcd | 2:8382613c86a0 | 1 | /* |
| el17mcd | 16:a2c945279b79 | 2 | ELEC2645 Embedded Systems Project: |
| el17mcd | 2:8382613c86a0 | 3 | School of Electronic & Electrical Engineering |
| el17mcd | 2:8382613c86a0 | 4 | University of Leeds |
| el17mcd | 2:8382613c86a0 | 5 | Name: Maxim C. Delacoe |
| el17mcd | 2:8382613c86a0 | 6 | Username: EL 17 MCD |
| el17mcd | 2:8382613c86a0 | 7 | Student ID Number: 2011 58344 |
| el17mcd | 2:8382613c86a0 | 8 | Date: 19/03/2019 |
| el17mcd | 16:a2c945279b79 | 9 | Game: Tanks! |
| el17mcd | 2:8382613c86a0 | 10 | */ |
| el17mcd | 2:8382613c86a0 | 11 | ///////// pre-processor directives //////// |
| el17mcd | 2:8382613c86a0 | 12 | #include "mbed.h" |
| el17mcd | 2:8382613c86a0 | 13 | #include "Gamepad.h" |
| el17mcd | 2:8382613c86a0 | 14 | #include "N5110.h" |
| el17mcd | 2:8382613c86a0 | 15 | #include "Bitmap.h" |
| el17mcd | 17:cb39d9fa08dc | 16 | #include "TanksEngine.h" |
| el17mcd | 12:9e6d5d0a0c82 | 17 | #include "Tank.h" |
| el17mcd | 7:a3ccabdebe2e | 18 | #include "Projectile.h" |
| el17mcd | 12:9e6d5d0a0c82 | 19 | #include "Graphics.h" |
| el17mcd | 15:fa5282fcd134 | 20 | #include "Menus.h" |
| el17mcd | 16:a2c945279b79 | 21 | #include "Scores.h" |
| el17mcd | 2:8382613c86a0 | 22 | |
| el17mcd | 7:a3ccabdebe2e | 23 | #ifdef WITH_TESTING |
| el17mcd | 2:8382613c86a0 | 24 | |
| el17mcd | 7:a3ccabdebe2e | 25 | #endif |
| el17mcd | 7:a3ccabdebe2e | 26 | |
| el17mcd | 7:a3ccabdebe2e | 27 | /////////////// objects /////////////// |
| el17mcd | 7:a3ccabdebe2e | 28 | N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); |
| el17mcd | 7:a3ccabdebe2e | 29 | TanksEngine engine; |
| el17mcd | 11:4e2eb64031a0 | 30 | Gamepad pad; |
| el17mcd | 12:9e6d5d0a0c82 | 31 | Graphics graphics; |
| el17mcd | 15:fa5282fcd134 | 32 | Menus menus; |
| el17mcd | 16:a2c945279b79 | 33 | Scores scores; |
| el17mcd | 2:8382613c86a0 | 34 | |
| el17mcd | 2:8382613c86a0 | 35 | int main() |
| el17mcd | 16:a2c945279b79 | 36 | { // need to initialise LCD and Gamepad |
| el17mcd | 17:cb39d9fa08dc | 37 | lcd.init(); |
| el17mcd | 17:cb39d9fa08dc | 38 | pad.init(); |
| el17mcd | 15:fa5282fcd134 | 39 | |
| el17mcd | 17:cb39d9fa08dc | 40 | while(1) { // infinite loop |
| el17mcd | 17:cb39d9fa08dc | 41 | menus.start_up_screen(graphics, lcd, pad); |
| el17mcd | 17:cb39d9fa08dc | 42 | menus.main_menu(graphics, lcd, pad, scores); |
| el17mcd | 17:cb39d9fa08dc | 43 | engine.initgame(menus); |
| el17mcd | 17:cb39d9fa08dc | 44 | engine.game_loop(graphics, lcd, pad, menus, scores); |
| el17mcd | 17:cb39d9fa08dc | 45 | } |
| el17mcd | 8:d4e419dad90f | 46 | } |