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 paddle.h Source File

paddle.h

00001 #include "ST7735_TFT.h"
00002 
00003 class Paddle {
00004   /* This class creates a paddle object */
00005  
00006   // Attributes
00007   int x,y,width,height,color,lives,score;
00008 
00009 public: 
00010   // Constructors
00011   Paddle();
00012   Paddle(int x, int y, int w, int h, int c, int l, int s);
00013   
00014   // Member functions
00015   void move(ST7735_TFT &lcd, int increment);
00016   void moveCPU(ST7735_TFT &lcd, int _y);
00017   void draw(ST7735_TFT &lcd, bool isBlack) const;
00018   bool loseLife();
00019   void addPoint();
00020   int size() const;
00021   int getWidth() const;
00022   int getHeight() const;
00023   int getX() const;
00024   int getY() const;
00025   int getLives() const;
00026   int getScore() const;
00027   void setLives(int l);
00028   
00029 };