Brickbreaker

Dependencies:   NokiaLCD PS2 mbed

Fork of Pong by William Johnston

ball.h

Committer:
ipapp3
Date:
2013-04-29
Revision:
4:f3ac45fa2196
Parent:
3:e1328f84b107

File content as of revision 4:f3ac45fa2196:

#include "NokiaLCD.h"

class Ball {
  /* This class creates a ball object */
  
  // Attributes
  int x,y,width,height,color,xInc,yInc;

public:
  // Constructors
  Ball();
  Ball(int x, int y, int w, int h, int c, int xi, int yi);
  
  // Member functions
  void move(NokiaLCD &lcd);
  void draw(NokiaLCD &lcd, bool isBlack) const;
  int getX() const;
  int getY() const;
  bool hitX();
  bool hitY();
  bool hitP1(int _x, int _y, int _height);
  bool hitB1(int _x, int _y, int _height);
  int size() const;
  void reverseX();
  void reverseY();
};