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.
lib/Controls/Controls.cpp@23:ecb74e52163d, 2019-05-09 (annotated)
- Committer:
- Kern_EL17KJTF
- Date:
- Thu May 09 00:25:50 2019 +0000
- Revision:
- 23:ecb74e52163d
- Parent:
- 19:8400ecdb69e9
Documentation - Options Class Complete.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kern_EL17KJTF | 13:94abfe83a294 | 1 | /* |
Kern_EL17KJTF | 13:94abfe83a294 | 2 | ELEC2645 Project |
Kern_EL17KJTF | 13:94abfe83a294 | 3 | Controls.cpp |
Kern_EL17KJTF | 13:94abfe83a294 | 4 | Class file for Controls in Donkey Kong game. |
Kern_EL17KJTF | 13:94abfe83a294 | 5 | */ |
Kern_EL17KJTF | 13:94abfe83a294 | 6 | |
Kern_EL17KJTF | 13:94abfe83a294 | 7 | #include "Controls.h" |
Kern_EL17KJTF | 13:94abfe83a294 | 8 | |
Kern_EL17KJTF | 19:8400ecdb69e9 | 9 | // Constructor - Doesn't require any setup. |
Kern_EL17KJTF | 13:94abfe83a294 | 10 | Controls::Controls() |
Kern_EL17KJTF | 13:94abfe83a294 | 11 | { |
Kern_EL17KJTF | 13:94abfe83a294 | 12 | |
Kern_EL17KJTF | 13:94abfe83a294 | 13 | } |
Kern_EL17KJTF | 13:94abfe83a294 | 14 | |
Kern_EL17KJTF | 19:8400ecdb69e9 | 15 | // Deconstructor - Doesn't require any setup. |
Kern_EL17KJTF | 13:94abfe83a294 | 16 | Controls::~Controls() |
Kern_EL17KJTF | 13:94abfe83a294 | 17 | { |
Kern_EL17KJTF | 13:94abfe83a294 | 18 | |
Kern_EL17KJTF | 13:94abfe83a294 | 19 | } |
Kern_EL17KJTF | 13:94abfe83a294 | 20 | |
Kern_EL17KJTF | 19:8400ecdb69e9 | 21 | // Prints various text to screen relating to the game controls. |
Kern_EL17KJTF | 13:94abfe83a294 | 22 | void Controls::controls_run(Gamepad &pad, N5110 &lcd) { |
Kern_EL17KJTF | 13:94abfe83a294 | 23 | wait_ms(250); |
Kern_EL17KJTF | 19:8400ecdb69e9 | 24 | while (pad.check_event(Gamepad::BACK_PRESSED) == false) { // Continues to show this screen until BACK button pressed. |
Kern_EL17KJTF | 13:94abfe83a294 | 25 | //printf("Control State"); |
Kern_EL17KJTF | 13:94abfe83a294 | 26 | lcd.clear(); |
Kern_EL17KJTF | 13:94abfe83a294 | 27 | lcd.printString("Controls",19,0); |
Kern_EL17KJTF | 13:94abfe83a294 | 28 | lcd.printString("Move Joystick ",0,2); |
Kern_EL17KJTF | 13:94abfe83a294 | 29 | lcd.printString("Left or Right ",0,3); |
Kern_EL17KJTF | 13:94abfe83a294 | 30 | lcd.printString(" to move ",0,4); |
Kern_EL17KJTF | 13:94abfe83a294 | 31 | lcd.printString(" Donkey Kong ",0,5); |
Kern_EL17KJTF | 23:ecb74e52163d | 32 | lcd.refresh(); // Reloads screen on every cycle, controlled by fps. Default set to 24. |
Kern_EL17KJTF | 13:94abfe83a294 | 33 | wait_ms(1.0f/24); |
Kern_EL17KJTF | 13:94abfe83a294 | 34 | } |
Kern_EL17KJTF | 13:94abfe83a294 | 35 | } |