Brickbreaker
Dependencies: NokiaLCD PS2 mbed
Fork of Pong by
ball.h@4:f3ac45fa2196, 2013-04-29 (annotated)
- Committer:
- ipapp3
- Date:
- Mon Apr 29 18:17:51 2013 +0000
- Revision:
- 4:f3ac45fa2196
- Parent:
- 3:e1328f84b107
final
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wjohnsto | 0:93dce1e528b9 | 1 | #include "NokiaLCD.h" |
wjohnsto | 0:93dce1e528b9 | 2 | |
wjohnsto | 0:93dce1e528b9 | 3 | class Ball { |
wjohnsto | 0:93dce1e528b9 | 4 | /* This class creates a ball object */ |
wjohnsto | 0:93dce1e528b9 | 5 | |
wjohnsto | 0:93dce1e528b9 | 6 | // Attributes |
wjohnsto | 0:93dce1e528b9 | 7 | int x,y,width,height,color,xInc,yInc; |
wjohnsto | 0:93dce1e528b9 | 8 | |
wjohnsto | 0:93dce1e528b9 | 9 | public: |
wjohnsto | 1:3cc8b1413557 | 10 | // Constructors |
wjohnsto | 0:93dce1e528b9 | 11 | Ball(); |
wjohnsto | 0:93dce1e528b9 | 12 | Ball(int x, int y, int w, int h, int c, int xi, int yi); |
wjohnsto | 0:93dce1e528b9 | 13 | |
wjohnsto | 0:93dce1e528b9 | 14 | // Member functions |
wjohnsto | 0:93dce1e528b9 | 15 | void move(NokiaLCD &lcd); |
wjohnsto | 0:93dce1e528b9 | 16 | void draw(NokiaLCD &lcd, bool isBlack) const; |
wjohnsto | 0:93dce1e528b9 | 17 | int getX() const; |
wjohnsto | 0:93dce1e528b9 | 18 | int getY() const; |
wjohnsto | 0:93dce1e528b9 | 19 | bool hitX(); |
wjohnsto | 0:93dce1e528b9 | 20 | bool hitY(); |
wjohnsto | 0:93dce1e528b9 | 21 | bool hitP1(int _x, int _y, int _height); |
ipapp3 | 3:e1328f84b107 | 22 | bool hitB1(int _x, int _y, int _height); |
wjohnsto | 0:93dce1e528b9 | 23 | int size() const; |
wjohnsto | 0:93dce1e528b9 | 24 | void reverseX(); |
wjohnsto | 0:93dce1e528b9 | 25 | void reverseY(); |
wjohnsto | 0:93dce1e528b9 | 26 | }; |