Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE PinDetect mbed
gobbleBuzz.h
00001 #ifndef GOBBLE_BUZZ_H 00002 #define GOBBLE_BUZZ 00003 00004 //I am okay with keeping these 00005 //as define statements for the colors 00006 #define WHITE 0xFFFFFF 00007 #define BLACK 0x000000 00008 #define RED 0xFF0000 00009 #define GREEN 0x00FF00 00010 #define BLUE 0x0000FF 00011 #define LGREY 0xBFBFBF 00012 #define DGREY 0x5F5F5F 00013 #define YELLOW 0xFFFF00 00014 #define BROWN 0x964B00 00015 00016 //Maybe these should be c++ constants 00017 //defined in your GobbleBuzz class!! 00018 #define X_DELTA 5 00019 #define Y_DELTA 5 00020 00021 class GobbleBuzz 00022 { 00023 public: 00024 GobbleBuzz(): xpos(50), ypos(50) { copyX();copyY();} 00025 inline void copyX(){ xOLDpos = xpos;} 00026 inline void copyY() {yOLDpos = ypos;} 00027 inline void increaseX() { xpos+=X_DELTA ;} 00028 inline void increaseY() { ypos+=Y_DELTA;} 00029 inline void decreaseX() { xpos-=X_DELTA; } 00030 inline void decreaseY() { ypos-=Y_DELTA; } 00031 00032 bool overlap(int,int,int,int); 00033 00034 int getXPos() const { return xpos; } 00035 int getYPos() const { return ypos; } 00036 int getOLDXPos() const { return xOLDpos; } 00037 int getOLDYPos() const {return yOLDpos; } 00038 00039 private: 00040 int xpos; 00041 int ypos; 00042 int xOLDpos; 00043 int yOLDpos; 00044 00045 }; 00046 00047 #endif
Generated on Tue Nov 22 2022 16:42:34 by
1.7.2