![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Brickbreaker
Dependencies: NokiaLCD PS2 mbed
Fork of Pong by
Diff: ball.h
- Revision:
- 0:93dce1e528b9
- Child:
- 1:3cc8b1413557
diff -r 000000000000 -r 93dce1e528b9 ball.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ball.h Sun Feb 27 23:35:17 2011 +0000 @@ -0,0 +1,26 @@ +#include "NokiaLCD.h" + +class Ball { + /* This class creates a ball object */ + + // Attributes + int x,y,width,height,color,xInc,yInc; + +public: + // Constructor + Ball(); + Ball(int x, int y, int w, int h, int c, int xi, int yi); + + // Member functions + void move(NokiaLCD &lcd); + void draw(NokiaLCD &lcd, bool isBlack) const; + int getX() const; + int getY() const; + bool hitX(); + bool hitY(); + bool hitP1(int _x, int _y, int _height); + bool hitP2(int _x, int _y, int _height); + int size() const; + void reverseX(); + void reverseY(); +}; \ No newline at end of file