Yang Zhenye 201199680
Dependencies: mbed
Ball/Ball.h@1:74f525027af6, 2020-04-28 (annotated)
- Committer:
- yangzhenye
- Date:
- Tue Apr 28 10:21:42 2020 +0000
- Revision:
- 1:74f525027af6
- Child:
- 5:fcad75e9b9e1
Ball model
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 | 1:74f525027af6 | 12 | Ball(); |
yangzhenye | 1:74f525027af6 | 13 | ~Ball(); |
yangzhenye | 1:74f525027af6 | 14 | void init(int size,int speed); |
yangzhenye | 1:74f525027af6 | 15 | void draw(N5110 &lcd); |
yangzhenye | 1:74f525027af6 | 16 | void update(); |
yangzhenye | 1:74f525027af6 | 17 | void set_velocity(Vector2D v); |
yangzhenye | 1:74f525027af6 | 18 | Vector2D get_velocity(); |
yangzhenye | 1:74f525027af6 | 19 | Vector2D get_pos(); |
yangzhenye | 1:74f525027af6 | 20 | void set_pos(Vector2D p); |
yangzhenye | 1:74f525027af6 | 21 | |
yangzhenye | 1:74f525027af6 | 22 | private: |
yangzhenye | 1:74f525027af6 | 23 | |
yangzhenye | 1:74f525027af6 | 24 | Vector2D _velocity; |
yangzhenye | 1:74f525027af6 | 25 | int _size; |
yangzhenye | 1:74f525027af6 | 26 | int _x; |
yangzhenye | 1:74f525027af6 | 27 | int _y; |
yangzhenye | 1:74f525027af6 | 28 | }; |
yangzhenye | 1:74f525027af6 | 29 | #endif |