![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
N5110
Paddle/Paddle.h@0:90b7f20b3a8d, 2020-04-28 (annotated)
- Committer:
- aileen
- Date:
- Tue Apr 28 01:39:30 2020 +0000
- Revision:
- 0:90b7f20b3a8d
N5110
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aileen | 0:90b7f20b3a8d | 1 | #ifndef PADDLE_H |
aileen | 0:90b7f20b3a8d | 2 | #define PADDLE_H |
aileen | 0:90b7f20b3a8d | 3 | |
aileen | 0:90b7f20b3a8d | 4 | #include "mbed.h" |
aileen | 0:90b7f20b3a8d | 5 | #include "N5110.h" |
aileen | 0:90b7f20b3a8d | 6 | #include "Gamepad.h" |
aileen | 0:90b7f20b3a8d | 7 | |
aileen | 0:90b7f20b3a8d | 8 | class Paddle |
aileen | 0:90b7f20b3a8d | 9 | { |
aileen | 0:90b7f20b3a8d | 10 | public: |
aileen | 0:90b7f20b3a8d | 11 | |
aileen | 0:90b7f20b3a8d | 12 | Paddle(); |
aileen | 0:90b7f20b3a8d | 13 | ~Paddle(); |
aileen | 0:90b7f20b3a8d | 14 | void init(int x,int height,int width); |
aileen | 0:90b7f20b3a8d | 15 | void draw(N5110 &lcd); |
aileen | 0:90b7f20b3a8d | 16 | void update(Direction d,float mag); |
aileen | 0:90b7f20b3a8d | 17 | void add_score(); |
aileen | 0:90b7f20b3a8d | 18 | int get_score(); |
aileen | 0:90b7f20b3a8d | 19 | Vector2D get_pos(); |
aileen | 0:90b7f20b3a8d | 20 | |
aileen | 0:90b7f20b3a8d | 21 | private: |
aileen | 0:90b7f20b3a8d | 22 | |
aileen | 0:90b7f20b3a8d | 23 | int _height; |
aileen | 0:90b7f20b3a8d | 24 | int _width; |
aileen | 0:90b7f20b3a8d | 25 | int _x; |
aileen | 0:90b7f20b3a8d | 26 | int _y; |
aileen | 0:90b7f20b3a8d | 27 | int _speed; |
aileen | 0:90b7f20b3a8d | 28 | int _score; |
aileen | 0:90b7f20b3a8d | 29 | |
aileen | 0:90b7f20b3a8d | 30 | }; |
aileen | 0:90b7f20b3a8d | 31 | #endif |