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
UserInteraction/UX.h@21:a0904159e183, 2019-04-30 (annotated)
- Committer:
- shahidsajid
- Date:
- Tue Apr 30 13:17:14 2019 +0000
- Revision:
- 21:a0904159e183
- Parent:
- Bat/Bat.h@20:9d21599fe350
- Child:
- 22:69d7fe739872
Created text for the rules and controls menus;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| shahidsajid | 21:a0904159e183 | 1 | #ifndef UX_H |
| shahidsajid | 21:a0904159e183 | 2 | #define UX_H |
| shahidsajid | 4:55a0509c4874 | 3 | |
| shahidsajid | 4:55a0509c4874 | 4 | #include "mbed.h" |
| shahidsajid | 4:55a0509c4874 | 5 | #include "N5110.h" |
| shahidsajid | 4:55a0509c4874 | 6 | #include "Gamepad.h" |
| shahidsajid | 4:55a0509c4874 | 7 | |
| shahidsajid | 4:55a0509c4874 | 8 | /** Ball Class |
| shahidsajid | 4:55a0509c4874 | 9 | @author Dr Craig A. Evans, University of Leeds |
| shahidsajid | 4:55a0509c4874 | 10 | @brief Controls the ball in the Pong game |
| shahidsajid | 4:55a0509c4874 | 11 | @date Febraury 2017 |
| shahidsajid | 4:55a0509c4874 | 12 | */ |
| shahidsajid | 21:a0904159e183 | 13 | class UX |
| shahidsajid | 4:55a0509c4874 | 14 | { |
| shahidsajid | 4:55a0509c4874 | 15 | |
| shahidsajid | 4:55a0509c4874 | 16 | public: |
| shahidsajid | 21:a0904159e183 | 17 | UX(); |
| shahidsajid | 21:a0904159e183 | 18 | ~UX(); |
| shahidsajid | 21:a0904159e183 | 19 | void init(); |
| shahidsajid | 4:55a0509c4874 | 20 | void draw(N5110 &lcd); |
| shahidsajid | 4:55a0509c4874 | 21 | void update(); |
| shahidsajid | 21:a0904159e183 | 22 | int get_a_pressed(); |
| shahidsajid | 21:a0904159e183 | 23 | int get_l_pressed(); |
| shahidsajid | 13:924891519a95 | 24 | void reset(); |
| shahidsajid | 13:924891519a95 | 25 | int get_loft_ball(); |
| shahidsajid | 20:9d21599fe350 | 26 | void first_menu(N5110 &menu_lcd,Gamepad &pad); |
| shahidsajid | 15:81a3aaf52647 | 27 | void second_menu(N5110 &menu_lcd); |
| shahidsajid | 21:a0904159e183 | 28 | void menu_options(N5110 &menu_lcd); |
| shahidsajid | 21:a0904159e183 | 29 | void rules_menu(N5110 &menu_lcd); |
| shahidsajid | 21:a0904159e183 | 30 | void controls_menu(N5110 &menu_lcd); |
| shahidsajid | 15:81a3aaf52647 | 31 | void game_over(string message); |
| shahidsajid | 18:a260ce8db9e7 | 32 | void game_over_menu(N5110 &menu_lcd,int option); |
| shahidsajid | 18:a260ce8db9e7 | 33 | void victory_menu(N5110 &menu_lcd); |
| shahidsajid | 18:a260ce8db9e7 | 34 | void info_screen(N5110 &menu_lcd, int target); |
| shahidsajid | 4:55a0509c4874 | 35 | /// accessors and mutators |
| shahidsajid | 14:122eaa3b7a50 | 36 | |
| shahidsajid | 4:55a0509c4874 | 37 | |
| shahidsajid | 4:55a0509c4874 | 38 | private: |
| shahidsajid | 14:122eaa3b7a50 | 39 | |
| shahidsajid | 14:122eaa3b7a50 | 40 | |
| shahidsajid | 6:3e50f2cf4366 | 41 | Gamepad batPad; |
| shahidsajid | 6:3e50f2cf4366 | 42 | int _hitBall; |
| shahidsajid | 13:924891519a95 | 43 | int _loft_ball; |
| shahidsajid | 4:55a0509c4874 | 44 | int d; |
| shahidsajid | 6:3e50f2cf4366 | 45 | Direction _d; |
| shahidsajid | 4:55a0509c4874 | 46 | int _size; |
| shahidsajid | 4:55a0509c4874 | 47 | int _x; |
| shahidsajid | 4:55a0509c4874 | 48 | int _y; |
| shahidsajid | 20:9d21599fe350 | 49 | bool _button_pressed; |
| shahidsajid | 4:55a0509c4874 | 50 | }; |
| shahidsajid | 4:55a0509c4874 | 51 | #endif |