Starter code for Georgia Tech ECE 2036 Summer 2014 Lab 2
Dependencies: 4DGL-uLCD-SE PinDetect mbed
Diff: paddle.h
- Revision:
- 0:356124c0bafc
diff -r 000000000000 -r 356124c0bafc paddle.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paddle.h Tue Jun 17 20:03:41 2014 +0000 @@ -0,0 +1,37 @@ +#include "uLCD_4DGL.h" + +class Paddle +{ +public: + // Constructors + Paddle(int, int); + Paddle(int, int, int, int); + // Set Functions + void setLength(int); + void setWidth(int); + void setPaddleMove(int); + void setLimits(int, int); // upper and lower limits of the paddle + // Get Function + int getScore(); + // Member Functions + void movePaddle(bool); // moves the paddle locations (does not draw!) + bool checkHitX(int, int, int); // Using a position and radius, checks to see if something has hit the paddle in the x direction + bool checkHitY(int, int, int); // Using a position and radius, checks to see if something has hit the paddle in the y direction + void resetScore(); // sets score to 0 + void initDraw(uLCD_4DGL *uLCD); // draw the paddle initially (draws the whole thing) + void redraw(uLCD_4DGL *uLCD); // draws the paddle for a move (does NOT draw the whole thing) + + +private: + // Data members are suggestions, feel free to add/remove + int score; + int x; + int y; + int oldy; + int length; + int width; + int paddleMove; + int topLimit; + int bottomLimit; +}; +