ST7735 Pong by Jonne Valola, derived work from William Johnston\'s mbed Pong for NokiaLCD / PS2 keyboard This pong uses a rotary encoder hooked to pins 21 and 22, ST7735_TFT library by me, RotaryEncoder library by Shinichiro Nakamura. All copyrights of respective owners. Use on your own risk and discretion.

Dependencies:   mbed ST7735_TFT RotaryEncoder TFT_fonts_old

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ball.h Source File

ball.h

00001 #include "ST7735_TFT.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(ST7735_TFT &lcd);
00016   void draw(ST7735_TFT &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 };