Class containing methods to draw a ball within the maze game with the specified position, size and fill style parameters.
Ball.cpp@0:4c58ed26b6ea, 2017-04-04 (annotated)
- Committer:
- el15mh
- Date:
- Tue Apr 04 10:30:48 2017 +0000
- Revision:
- 0:4c58ed26b6ea
- Child:
- 1:ba8bb10ebd5a
menu with first animation trial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el15mh | 0:4c58ed26b6ea | 1 | // |
el15mh | 0:4c58ed26b6ea | 2 | // ball.cpp |
el15mh | 0:4c58ed26b6ea | 3 | // |
el15mh | 0:4c58ed26b6ea | 4 | // |
el15mh | 0:4c58ed26b6ea | 5 | // Created by Max Houghton on 19/03/2017. |
el15mh | 0:4c58ed26b6ea | 6 | // |
el15mh | 0:4c58ed26b6ea | 7 | // |
el15mh | 0:4c58ed26b6ea | 8 | |
el15mh | 0:4c58ed26b6ea | 9 | #include "Ball.h" |
el15mh | 0:4c58ed26b6ea | 10 | |
el15mh | 0:4c58ed26b6ea | 11 | Ball::Ball() |
el15mh | 0:4c58ed26b6ea | 12 | { |
el15mh | 0:4c58ed26b6ea | 13 | |
el15mh | 0:4c58ed26b6ea | 14 | } |
el15mh | 0:4c58ed26b6ea | 15 | |
el15mh | 0:4c58ed26b6ea | 16 | Ball::~Ball() |
el15mh | 0:4c58ed26b6ea | 17 | { |
el15mh | 0:4c58ed26b6ea | 18 | |
el15mh | 0:4c58ed26b6ea | 19 | } |
el15mh | 0:4c58ed26b6ea | 20 | |
el15mh | 0:4c58ed26b6ea | 21 | void Ball::draw(N5110 &lcd, int x, int y, int radius) |
el15mh | 0:4c58ed26b6ea | 22 | { |
el15mh | 0:4c58ed26b6ea | 23 | // lcd.clear(); |
el15mh | 0:4c58ed26b6ea | 24 | float _x = x; |
el15mh | 0:4c58ed26b6ea | 25 | float _y = y; |
el15mh | 0:4c58ed26b6ea | 26 | float _radius = radius; |
el15mh | 0:4c58ed26b6ea | 27 | |
el15mh | 0:4c58ed26b6ea | 28 | printf("INPUT: x = %i, y = %i, radius = %i \n", x, y, radius); |
el15mh | 0:4c58ed26b6ea | 29 | printf("DRAW FUNCTION: x = %f, y = %f, radius = %f \n", _x, _y, _radius); |
el15mh | 0:4c58ed26b6ea | 30 | // lcd.drawCircle(x,y,radius,filltype); |
el15mh | 0:4c58ed26b6ea | 31 | |
el15mh | 0:4c58ed26b6ea | 32 | // lcd.drawCircle(43, 21, 5, FILL_TRANSPARENT); |
el15mh | 0:4c58ed26b6ea | 33 | lcd.drawCircle(_x, _y, _radius, FILL_TRANSPARENT); |
el15mh | 0:4c58ed26b6ea | 34 | lcd.refresh(); |
el15mh | 0:4c58ed26b6ea | 35 | } |
el15mh | 0:4c58ed26b6ea | 36 | |
el15mh | 0:4c58ed26b6ea | 37 |