![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Game designed for project
MyClasses/Ball/Ball.h@3:5ede4ac61af1, 2020-05-24 (annotated)
- Committer:
- vaib
- Date:
- Sun May 24 09:15:25 2020 +0000
- Revision:
- 3:5ede4ac61af1
Created a class for the balls's movement and am now working of the obstacles/blocks
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vaib | 3:5ede4ac61af1 | 1 | #ifndef BALL_H |
vaib | 3:5ede4ac61af1 | 2 | #define BALL_H |
vaib | 3:5ede4ac61af1 | 3 | |
vaib | 3:5ede4ac61af1 | 4 | #include "mbed.h" |
vaib | 3:5ede4ac61af1 | 5 | #include "N5110.h" |
vaib | 3:5ede4ac61af1 | 6 | #include "Gamepad.h" |
vaib | 3:5ede4ac61af1 | 7 | |
vaib | 3:5ede4ac61af1 | 8 | class Ball |
vaib | 3:5ede4ac61af1 | 9 | { |
vaib | 3:5ede4ac61af1 | 10 | public: |
vaib | 3:5ede4ac61af1 | 11 | |
vaib | 3:5ede4ac61af1 | 12 | void init(int radius, int height, int speed); |
vaib | 3:5ede4ac61af1 | 13 | void print_lcd(N5110 &lcd); |
vaib | 3:5ede4ac61af1 | 14 | void set_size(int radius); |
vaib | 3:5ede4ac61af1 | 15 | void set_position(int x, int y); |
vaib | 3:5ede4ac61af1 | 16 | void set_velocity(Vector2D velocity); |
vaib | 3:5ede4ac61af1 | 17 | void update_position(); |
vaib | 3:5ede4ac61af1 | 18 | Vector2D get_position(); |
vaib | 3:5ede4ac61af1 | 19 | Vector2D get_velocity(); |
vaib | 3:5ede4ac61af1 | 20 | |
vaib | 3:5ede4ac61af1 | 21 | private: |
vaib | 3:5ede4ac61af1 | 22 | |
vaib | 3:5ede4ac61af1 | 23 | int _radius; |
vaib | 3:5ede4ac61af1 | 24 | int _x; |
vaib | 3:5ede4ac61af1 | 25 | int _y; |
vaib | 3:5ede4ac61af1 | 26 | Vector2D _velocity; |
vaib | 3:5ede4ac61af1 | 27 | |
vaib | 3:5ede4ac61af1 | 28 | } |
vaib | 3:5ede4ac61af1 | 29 | #endif |