player 1

Dependencies:   4DGL-uLCD-SE PinDetect SparkfunAnalogJoystick mbed-rtos mbed SDFileSystem

Fork of 4180FinalLab by Rishi Bhargava

Wireless 2 Player Pong game

Committer:
Mpmart08
Date:
Fri Apr 29 00:51:56 2016 +0000
Revision:
10:b57b3fbf8266
Parent:
8:8cc2aa78348c
wifi stuff

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jlind6 0:356124c0bafc 1 #include "uLCD_4DGL.h"
jlind6 0:356124c0bafc 2
jlind6 0:356124c0bafc 3 class Paddle
jlind6 0:356124c0bafc 4 {
jlind6 0:356124c0bafc 5 public:
jlind6 0:356124c0bafc 6 // Constructors
rishibhargava1 3:591086e44bf9 7 Paddle(uint8_t, uint8_t, uint8_t, uint8_t);
jlind6 0:356124c0bafc 8 // Set Functions
rishibhargava1 3:591086e44bf9 9 void setLimits(uint8_t, uint8_t); // left and right limits of the paddle
rishibhargava1 3:591086e44bf9 10 void setMaxMove(uint8_t);
rishibhargava1 3:591086e44bf9 11 // Paddle location functions
rishibhargava1 3:591086e44bf9 12 uint8_t getX();
rishibhargava1 3:591086e44bf9 13 void setX(uint8_t);
jlind6 0:356124c0bafc 14 // Member Functions
rishibhargava1 3:591086e44bf9 15 void move(float); // false means move left, true means move right
rishibhargava1 3:591086e44bf9 16 bool checkHit(uint8_t, uint8_t, uint8_t); // Using a position and size, checks to see if something has hit the paddle
Mpmart08 8:8cc2aa78348c 17 uint8_t returnAngle(uint8_t, uint8_t); // Using a ball x position, gives a return vx and vxDir
rishibhargava1 3:591086e44bf9 18 bool returnDir(uint8_t, uint8_t);
rishibhargava1 3:591086e44bf9 19 void reset(uint8_t, uint8_t);
jlind6 0:356124c0bafc 20
jlind6 0:356124c0bafc 21 private:
jlind6 0:356124c0bafc 22 // Data members are suggestions, feel free to add/remove
rishibhargava1 3:591086e44bf9 23 uint8_t x;
rishibhargava1 3:591086e44bf9 24 uint8_t y;
rishibhargava1 3:591086e44bf9 25 uint8_t length;
rishibhargava1 3:591086e44bf9 26 uint8_t width;
rishibhargava1 3:591086e44bf9 27 uint8_t maxMove;
rishibhargava1 3:591086e44bf9 28 uint8_t leftLim;
rishibhargava1 3:591086e44bf9 29 uint8_t rightLim;
rishibhargava1 3:591086e44bf9 30 bool bottom; //0 is top, 1 is bottom
jlind6 0:356124c0bafc 31 };
jlind6 0:356124c0bafc 32