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 Joseph Lind

Committer:
dcleary
Date:
Thu Mar 17 20:38:26 2016 +0000
Revision:
3:c93d1b51785c
Parent:
0:356124c0bafc
Pong

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jlind6 0:356124c0bafc 1 #include "uLCD_4DGL.h"
dcleary 3:c93d1b51785c 2 #ifndef PADDLE_H
dcleary 3:c93d1b51785c 3 #define PADDLE_H
jlind6 0:356124c0bafc 4
jlind6 0:356124c0bafc 5 class Paddle
jlind6 0:356124c0bafc 6 {
jlind6 0:356124c0bafc 7 public:
jlind6 0:356124c0bafc 8 // Constructors
dcleary 3:c93d1b51785c 9 Paddle();
dcleary 3:c93d1b51785c 10
jlind6 0:356124c0bafc 11 // Set Functions
jlind6 0:356124c0bafc 12 void setLength(int);
jlind6 0:356124c0bafc 13 void setWidth(int);
dcleary 3:c93d1b51785c 14 void setPaddleMove(int);
dcleary 3:c93d1b51785c 15 void setScore(int);
dcleary 3:c93d1b51785c 16 void setX(int);
dcleary 3:c93d1b51785c 17 void setY(int);
dcleary 3:c93d1b51785c 18 void setOldY(int);
dcleary 3:c93d1b51785c 19
jlind6 0:356124c0bafc 20 // Get Function
dcleary 3:c93d1b51785c 21 int getLength();
dcleary 3:c93d1b51785c 22 int getWidth();
dcleary 3:c93d1b51785c 23 int getPaddleMove();
jlind6 0:356124c0bafc 24 int getScore();
dcleary 3:c93d1b51785c 25 int getX();
dcleary 3:c93d1b51785c 26 int getY();
dcleary 3:c93d1b51785c 27 int getOldY();
dcleary 3:c93d1b51785c 28
jlind6 0:356124c0bafc 29 // Member Functions
dcleary 3:c93d1b51785c 30 void movePaddleUp();
dcleary 3:c93d1b51785c 31 void movePaddleDown();
jlind6 0:356124c0bafc 32 void resetScore(); // sets score to 0
jlind6 0:356124c0bafc 33 void initDraw(uLCD_4DGL *uLCD); // draw the paddle initially (draws the whole thing)
jlind6 0:356124c0bafc 34 void redraw(uLCD_4DGL *uLCD); // draws the paddle for a move (does NOT draw the whole thing)
jlind6 0:356124c0bafc 35
jlind6 0:356124c0bafc 36
jlind6 0:356124c0bafc 37 private:
jlind6 0:356124c0bafc 38 int score;
jlind6 0:356124c0bafc 39 int x;
jlind6 0:356124c0bafc 40 int y;
jlind6 0:356124c0bafc 41 int oldy;
jlind6 0:356124c0bafc 42 int length;
jlind6 0:356124c0bafc 43 int width;
jlind6 0:356124c0bafc 44 int paddleMove;
jlind6 0:356124c0bafc 45 };
jlind6 0:356124c0bafc 46
dcleary 3:c93d1b51785c 47 #endif