Gregory Boudreau / Mbed 2 deprecated Lab6_2036_turkey_greg

Dependencies:   4DGL-uLCD-SE PinDetect mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers gobbleBuzz.h Source File

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