Yang Zhenye 201199680
Dependencies: mbed
Ball/Ball.h@9:a5a82b3d1102, 2020-05-15 (annotated)
- Committer:
- yangzhenye
- Date:
- Fri May 15 07:27:23 2020 +0000
- Revision:
- 9:a5a82b3d1102
- Parent:
- 5:fcad75e9b9e1
el17zy Yang Zhenye
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yangzhenye | 1:74f525027af6 | 1 | #ifndef BALL_H |
yangzhenye | 1:74f525027af6 | 2 | #define BALL_H |
yangzhenye | 1:74f525027af6 | 3 | |
yangzhenye | 1:74f525027af6 | 4 | #include "mbed.h" |
yangzhenye | 1:74f525027af6 | 5 | #include "N5110.h" |
yangzhenye | 1:74f525027af6 | 6 | #include "Gamepad.h" |
yangzhenye | 1:74f525027af6 | 7 | |
yangzhenye | 1:74f525027af6 | 8 | class Ball |
yangzhenye | 1:74f525027af6 | 9 | { |
yangzhenye | 1:74f525027af6 | 10 | |
yangzhenye | 1:74f525027af6 | 11 | public: |
yangzhenye | 5:fcad75e9b9e1 | 12 | // Constructor and destructor. |
yangzhenye | 5:fcad75e9b9e1 | 13 | /** |
yangzhenye | 5:fcad75e9b9e1 | 14 | * @brief Constructor @details Non user specified. |
yangzhenye | 5:fcad75e9b9e1 | 15 | */ |
yangzhenye | 1:74f525027af6 | 16 | Ball(); |
yangzhenye | 5:fcad75e9b9e1 | 17 | /** |
yangzhenye | 5:fcad75e9b9e1 | 18 | * @brief Destructor @details Non user specified. |
yangzhenye | 5:fcad75e9b9e1 | 19 | */ |
yangzhenye | 1:74f525027af6 | 20 | ~Ball(); |
yangzhenye | 1:74f525027af6 | 21 | void init(int size,int speed); |
yangzhenye | 1:74f525027af6 | 22 | void draw(N5110 &lcd); |
yangzhenye | 1:74f525027af6 | 23 | void update(); |
yangzhenye | 1:74f525027af6 | 24 | void set_velocity(Vector2D v); |
yangzhenye | 1:74f525027af6 | 25 | Vector2D get_velocity(); |
yangzhenye | 1:74f525027af6 | 26 | Vector2D get_pos(); |
yangzhenye | 1:74f525027af6 | 27 | void set_pos(Vector2D p); |
yangzhenye | 1:74f525027af6 | 28 | |
yangzhenye | 1:74f525027af6 | 29 | private: |
yangzhenye | 1:74f525027af6 | 30 | |
yangzhenye | 1:74f525027af6 | 31 | Vector2D _velocity; |
yangzhenye | 1:74f525027af6 | 32 | int _size; |
yangzhenye | 1:74f525027af6 | 33 | int _x; |
yangzhenye | 1:74f525027af6 | 34 | int _y; |
yangzhenye | 1:74f525027af6 | 35 | }; |
yangzhenye | 1:74f525027af6 | 36 | #endif |