Race around the city collecting the flags while avoiding those that stand in the way of your mission. Make no mistake you will need to be quick to outwit your opponents, they are smart and will try to box you in. I wrote this game to prove that writing a game with scrolling scenery is possible even with the limited 6kB of RAM available. I had to compromise sound effects for features, I wanted multiple opponents, I wanted to be able to drop smoke bombs to trap the opponents but all this required memory so the sound effects had to take a back seat.

Dependencies:   mbed

LCD_ST7735/Color565.h

Committer:
taylorza
Date:
2015-02-01
Revision:
1:1b8125937f28
Parent:
0:d85c449aca6d

File content as of revision 1:1b8125937f28:

///////////////////////////////////////////////////////////////////////////////
// LCD_ST7735 - Driver for ST7735 LCD display controller
// Author: Chris Taylor (taylorza)

#ifndef __COLOR565_H__
#define __COLOR565_H__
/** Color palete support for 16bit RGB colors with 565 color format
*/
class Color565
{
public:
    /**White*/
    static const uint16_t White;
    
    /**Silver*/
    static const uint16_t Silver;
    
    /**Gray*/
    static const uint16_t Gray;
    
    /**Black*/
    static const uint16_t Black;
    
    /**Red*/
    static const uint16_t Red;
    
    /**Maroon*/
    static const uint16_t Maroon;
    
    /**Yellow*/
    static const uint16_t Yellow;
    
    /**Olive*/
    static const uint16_t Olive;
    
    /**Lime*/
    static const uint16_t Lime;
    
    /**Green*/
    static const uint16_t Green;
    
    /**Aqua*/
    static const uint16_t Aqua;
    
    /**Teal*/
    static const uint16_t Teal;
    
    /**Blue*/
    static const uint16_t Blue;
    
    /**Navy*/
    static const uint16_t Navy;
    
    /**Fuchsia*/
    static const uint16_t Fuchsia;
    
    /**Purple*/
    static const uint16_t Purple;

    /**Returns a 565 RGB color built from individual RGB color components
     * @param r Red component
     * @param g Green component
     * @param b Blue component
    */    
    static uint16_t fromRGB(uint8_t r, uint8_t g, uint8_t b)
    {
        return ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3)  ;
    }
private:
    Color565(){};  
};
#endif // __COLOR565_H__