Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ELEC2645_JoystickLCD_LPC1768_2021
lib/Ball.cpp@8:1fc5e14b0db6, 2021-04-24 (annotated)
- Committer:
- alex_20
- Date:
- Sat Apr 24 21:31:19 2021 +0000
- Revision:
- 8:1fc5e14b0db6
- Parent:
- 1:2ae7a8b01771
- Child:
- 9:6f060f495536
Before game engine. ball done
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
alex_20 | 8:1fc5e14b0db6 | 1 | #include "Ball.h" |
alex_20 | 8:1fc5e14b0db6 | 2 | |
alex_20 | 8:1fc5e14b0db6 | 3 | // constructure |
alex_20 | 8:1fc5e14b0db6 | 4 | Ball::Ball() {} |
alex_20 | 8:1fc5e14b0db6 | 5 | |
alex_20 | 8:1fc5e14b0db6 | 6 | void Ball::init() { |
alex_20 | 8:1fc5e14b0db6 | 7 | //initialize parameters |
alex_20 | 8:1fc5e14b0db6 | 8 | //say that trajectory is 0 |
alex_20 | 8:1fc5e14b0db6 | 9 | } |
alex_20 | 8:1fc5e14b0db6 | 10 | |
alex_20 | 8:1fc5e14b0db6 | 11 | //std::vector<Vector2Df> Ball::get_path() { |
alex_20 | 8:1fc5e14b0db6 | 12 | // path points = utils.getCurve; |
alex_20 | 8:1fc5e14b0db6 | 13 | // return path_points; |
alex_20 | 8:1fc5e14b0db6 | 14 | // } |
alex_20 | 8:1fc5e14b0db6 | 15 | |
alex_20 | 8:1fc5e14b0db6 | 16 | void Ball::draw(N5110 &lcd, std::vector<Vector2Df> path_points, int radius, float iterator) { |
alex_20 | 8:1fc5e14b0db6 | 17 | lcd.drawCircle(static_cast<int>(path_points[iterator].x), static_cast<int>(path_points[iterator].y), radius, FILL_TRANSPARENT); |
alex_20 | 8:1fc5e14b0db6 | 18 | } |