Library that draws a basket on a Nokia N5110 LCD display and allows it to be moved left/right on the display using buttons or a joystick.
Dependents: Game_Controller_Project
Basket.h@0:7e132fca6044, 2017-03-14 (annotated)
- Committer:
- Nathanj94
- Date:
- Tue Mar 14 10:00:01 2017 +0000
- Revision:
- 0:7e132fca6044
- Child:
- 1:5e564d218751
Basket developed first, it can be moved across the bottom of the screen using the joystick and L/R buttons and has boundary conditions to keep it on the screen.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Nathanj94 | 0:7e132fca6044 | 1 | #ifndef BASKET_H |
Nathanj94 | 0:7e132fca6044 | 2 | #define BASKET_H |
Nathanj94 | 0:7e132fca6044 | 3 | |
Nathanj94 | 0:7e132fca6044 | 4 | #include "mbed.h" |
Nathanj94 | 0:7e132fca6044 | 5 | #include "N5110.h" |
Nathanj94 | 0:7e132fca6044 | 6 | #include "Gamepad.h" |
Nathanj94 | 0:7e132fca6044 | 7 | |
Nathanj94 | 0:7e132fca6044 | 8 | class Basket |
Nathanj94 | 0:7e132fca6044 | 9 | { |
Nathanj94 | 0:7e132fca6044 | 10 | public: |
Nathanj94 | 0:7e132fca6044 | 11 | |
Nathanj94 | 0:7e132fca6044 | 12 | Basket(); |
Nathanj94 | 0:7e132fca6044 | 13 | ~Basket(); |
Nathanj94 | 0:7e132fca6044 | 14 | void Basket_init(int y, int width); |
Nathanj94 | 0:7e132fca6044 | 15 | void Basket_draw(N5110 &lcd); |
Nathanj94 | 0:7e132fca6044 | 16 | void Basket_move(Direction d, float mag, Gamepad &pad); |
Nathanj94 | 0:7e132fca6044 | 17 | void Basket_score(); |
Nathanj94 | 0:7e132fca6044 | 18 | int get_Basket_score(); |
Nathanj94 | 0:7e132fca6044 | 19 | Vector2D Basket_position(); |
Nathanj94 | 0:7e132fca6044 | 20 | |
Nathanj94 | 0:7e132fca6044 | 21 | private: |
Nathanj94 | 0:7e132fca6044 | 22 | |
Nathanj94 | 0:7e132fca6044 | 23 | int basket_y; |
Nathanj94 | 0:7e132fca6044 | 24 | int basket_x; |
Nathanj94 | 0:7e132fca6044 | 25 | int basket_width; |
Nathanj94 | 0:7e132fca6044 | 26 | int basket_speed; |
Nathanj94 | 0:7e132fca6044 | 27 | int basket_score; |
Nathanj94 | 0:7e132fca6044 | 28 | |
Nathanj94 | 0:7e132fca6044 | 29 | }; |
Nathanj94 | 0:7e132fca6044 | 30 | #endif |
Nathanj94 | 0:7e132fca6044 | 31 |