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

ball.h

Committer:
jlind6
Date:
2014-06-17
Revision:
0:356124c0bafc
Child:
1:839d22d423bd

File content as of revision 0:356124c0bafc:

#include "tempModule.h"
#include "uLCD_4DGL.h"

class Ball
{
public:    
    // Constructors
    Ball(PinName);
    Ball(PinName, float, float, int);
    // Set Functions
    void setBaseVx(float); // This sets the lowest velocity of vx (for Thermal pong) or the constant velocity
    void setBaseVy(float); // This sets the lowest velocity of vy (for Thermal pong) or the constant velocity
    void setVxSign(int); 
    void setVySign(int);
    // Get Functions
    int getFutureX();   // get estimate of where the ball will be in the next update()
    int getFutureY();   // get estimate of where the ball will be in the next update()
    // Member Functions
    void reverseXDirection(); // negate the sign for when a ball hits something
    void reverseYDirection(); // negate the sign for when a ball hits something
    void reset(int, int, int, int, uLCD_4DGL *); // takes in a new location and new directions and draws the starting point for the ball
    void update(uLCD_4DGL *); // moves the ball on the screen one vx and vy
    
private:
    // Data members are suggestions, feel free to add/remove
    TempModule *tempSensor;
    int vxSign;
    int vySign;
    float fx;
    float fy;
    int x;
    int y;
    int radius;
    bool lose;
};