Simple Pong game on NokiaLCD with PS2

Dependencies:   mbed PS2 NokiaLCD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ball.h Source File

ball.h

00001 #include "NokiaLCD.h"
00002 
00003 class Ball {
00004   /* This class creates a ball object */
00005   
00006   // Attributes
00007   int x,y,width,height,color,xInc,yInc;
00008 
00009 public:
00010   // Constructors
00011   Ball();
00012   Ball(int x, int y, int w, int h, int c, int xi, int yi);
00013   
00014   // Member functions
00015   void move(NokiaLCD &lcd);
00016   void draw(NokiaLCD &lcd, bool isBlack) const;
00017   int getX() const;
00018   int getY() const;
00019   bool hitX();
00020   bool hitY();
00021   bool hitP1(int _x, int _y, int _height);
00022   bool hitP2(int _x, int _y, int _height);
00023   int size() const;
00024   void reverseX();
00025   void reverseY();
00026 };