Davon Cleary / Mbed 2 deprecated Lab2

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

Fork of ECE2036Lab2StarterCode by Joseph Lind

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ball.h Source File

ball.h

00001 #include "tempModule.h"
00002 #include "uLCD_4DGL.h"
00003 #include "paddle.h"
00004 
00005 class Ball
00006 {
00007 public: 
00008    
00009     // Constructors
00010     
00011     Ball();
00012     Ball(PinName);
00013     Ball(PinName,float, float);
00014 
00015     // Set Functions
00016     void setVx(float);// This sets the lowest velocity, for Thermal pong, or the constant velocity of x
00017     void setVy(float);// This sets the lowest velocity, for Thermal pong, or the constant velocity of y
00018     void setXSign(int); 
00019     void setYSign(int);
00020     void setRadius(int);
00021     void setFx(float);
00022     void setFy(float);
00023     void setX(int);
00024     void setY(int);
00025     void setLose(bool);
00026 
00027     // Get Functions
00028     int getFutureX();// calculate new X position
00029     int getFutureY();// calculate new Y position
00030     int getXSign();
00031     int getYSign();
00032     int getRadius();
00033     int getX();
00034     int getY();
00035     float getFx();
00036     float getFy();
00037     float getVx();
00038     float getVy();
00039     bool getLose();
00040 
00041     // Member Functions
00042     void reverseXDirection();// negate the sign when ball hits wall or paddle
00043     void reverseYDirection();// negate the sign when ball hits wall or paddle
00044     void startPong(int, uLCD_4DGL *);// initialize starting pointion for the ball
00045     void update(uLCD_4DGL *);// moves the ball on the screen
00046     void resetBall();
00047     void testConditions(Paddle *,uLCD_4DGL *); 
00048     
00049 private:
00050     TempModule *tempSensor;
00051     int xSign;
00052     int ySign;
00053     float fx;
00054     float fy;
00055     float vx;
00056     float vy;
00057     int x;
00058     int y;
00059     int radius;
00060     bool lose;
00061 };