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@4:4ce558075c32, 2017-03-21 (annotated)
- Committer:
- Nathanj94
- Date:
- Tue Mar 21 11:08:39 2017 +0000
- Revision:
- 4:4ce558075c32
- Parent:
- 3:d8deea6454df
- Child:
- 5:32421eb42841
functions added to get x and y coords for collision functions
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 | 2:5d4f2c3f3c0a | 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 | 2:5d4f2c3f3c0a | 16 | void Basket_move(Direction d, float mag); |
Nathanj94 | 0:7e132fca6044 | 17 | void Basket_score(); |
Nathanj94 | 0:7e132fca6044 | 18 | int get_Basket_score(); |
Nathanj94 | 4:4ce558075c32 | 19 | int get_Basket_x(); |
Nathanj94 | 4:4ce558075c32 | 20 | int get_Basket_y(); |
Nathanj94 | 0:7e132fca6044 | 21 | |
Nathanj94 | 0:7e132fca6044 | 22 | private: |
Nathanj94 | 2:5d4f2c3f3c0a | 23 | |
Nathanj94 | 0:7e132fca6044 | 24 | int basket_y; |
Nathanj94 | 0:7e132fca6044 | 25 | int basket_x; |
Nathanj94 | 0:7e132fca6044 | 26 | int basket_width; |
Nathanj94 | 0:7e132fca6044 | 27 | int basket_speed; |
Nathanj94 | 0:7e132fca6044 | 28 | int basket_score; |
Nathanj94 | 0:7e132fca6044 | 29 | |
Nathanj94 | 0:7e132fca6044 | 30 | }; |
Nathanj94 | 0:7e132fca6044 | 31 | #endif |
Nathanj94 | 0:7e132fca6044 | 32 |