One player pong with seven segment display for score keeping
Dependencies: 4DGL-uLCD-SE PinDetect SDFileSystem mbed-rtos mbed wave_player
Fork of ECE2036Lab2StarterCode by
Diff: paddle.h
- Revision:
- 3:c93d1b51785c
- Parent:
- 0:356124c0bafc
--- a/paddle.h Fri Jun 20 15:22:28 2014 +0000 +++ b/paddle.h Thu Mar 17 20:38:26 2016 +0000 @@ -1,29 +1,40 @@ #include "uLCD_4DGL.h" +#ifndef PADDLE_H +#define PADDLE_H class Paddle { public: // Constructors - Paddle(int, int); - Paddle(int, int, int, int); + Paddle(); + // Set Functions void setLength(int); void setWidth(int); - void setPaddleMove(int); - void setLimits(int, int); // upper and lower limits of the paddle + void setPaddleMove(int); + void setScore(int); + void setX(int); + void setY(int); + void setOldY(int); + // Get Function + int getLength(); + int getWidth(); + int getPaddleMove(); int getScore(); + int getX(); + int getY(); + int getOldY(); + // 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 movePaddleUp(); + void movePaddleDown(); 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; @@ -31,7 +42,6 @@ int length; int width; int paddleMove; - int topLimit; - int bottomLimit; }; +#endif