Flip tile pattern game
Dependencies: 4DGL-uLCD-SE PinDetect SDFileSystem mbed-rtos mbed wave_player
tile.h@1:4e25bf8e016e, 2015-10-22 (annotated)
- Committer:
- jsmith352
- Date:
- Thu Oct 22 15:28:45 2015 +0000
- Revision:
- 1:4e25bf8e016e
- Parent:
- 0:96656a61e4e3
flip tile
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jsmith352 | 0:96656a61e4e3 | 1 | #ifndef _TILE_H_ |
jsmith352 | 0:96656a61e4e3 | 2 | #define _TILE_H_ |
jsmith352 | 0:96656a61e4e3 | 3 | |
jsmith352 | 0:96656a61e4e3 | 4 | #include "uLCD_4DGL.h" |
jsmith352 | 0:96656a61e4e3 | 5 | |
jsmith352 | 0:96656a61e4e3 | 6 | |
jsmith352 | 0:96656a61e4e3 | 7 | #define TILE_OFF 0xFF0000 |
jsmith352 | 0:96656a61e4e3 | 8 | #define TILE_ON 0x00FF00 |
jsmith352 | 0:96656a61e4e3 | 9 | |
jsmith352 | 0:96656a61e4e3 | 10 | class Tile |
jsmith352 | 0:96656a61e4e3 | 11 | { |
jsmith352 | 0:96656a61e4e3 | 12 | public: |
jsmith352 | 0:96656a61e4e3 | 13 | // constructors |
jsmith352 | 0:96656a61e4e3 | 14 | Tile (PinName, PinName, PinName); |
jsmith352 | 0:96656a61e4e3 | 15 | |
jsmith352 | 0:96656a61e4e3 | 16 | // member functions |
jsmith352 | 0:96656a61e4e3 | 17 | void TilePattern3(int); // changes tile colors depending on input |
jsmith352 | 0:96656a61e4e3 | 18 | void TilePattern4(int); |
jsmith352 | 0:96656a61e4e3 | 19 | void setNumberOfTiles(bool); |
jsmith352 | 0:96656a61e4e3 | 20 | int getScore(); |
jsmith352 | 0:96656a61e4e3 | 21 | void reset(); |
jsmith352 | 0:96656a61e4e3 | 22 | void pause(); |
jsmith352 | 0:96656a61e4e3 | 23 | void unpause(); |
jsmith352 | 0:96656a61e4e3 | 24 | bool drawCursor(int); |
jsmith352 | 0:96656a61e4e3 | 25 | |
jsmith352 | 0:96656a61e4e3 | 26 | //members |
jsmith352 | 0:96656a61e4e3 | 27 | bool win; |
jsmith352 | 0:96656a61e4e3 | 28 | |
jsmith352 | 0:96656a61e4e3 | 29 | |
jsmith352 | 0:96656a61e4e3 | 30 | private: |
jsmith352 | 0:96656a61e4e3 | 31 | void TilePatternSetup(); |
jsmith352 | 0:96656a61e4e3 | 32 | void resetScore(); |
jsmith352 | 0:96656a61e4e3 | 33 | bool setup; |
jsmith352 | 0:96656a61e4e3 | 34 | bool number_of_tiles; // true = 3x3, false = 4x4 |
jsmith352 | 0:96656a61e4e3 | 35 | int score; |
jsmith352 | 0:96656a61e4e3 | 36 | uLCD_4DGL *LCD_ptr; |
jsmith352 | 0:96656a61e4e3 | 37 | |
jsmith352 | 0:96656a61e4e3 | 38 | // 3x3 squares |
jsmith352 | 0:96656a61e4e3 | 39 | void square0(); |
jsmith352 | 0:96656a61e4e3 | 40 | void square1(); |
jsmith352 | 0:96656a61e4e3 | 41 | void square2(); |
jsmith352 | 0:96656a61e4e3 | 42 | void square3(); |
jsmith352 | 0:96656a61e4e3 | 43 | void square4(); |
jsmith352 | 0:96656a61e4e3 | 44 | void square5(); |
jsmith352 | 0:96656a61e4e3 | 45 | void square6(); |
jsmith352 | 0:96656a61e4e3 | 46 | void square7(); |
jsmith352 | 0:96656a61e4e3 | 47 | void square8(); |
jsmith352 | 0:96656a61e4e3 | 48 | bool squares[9]; //false = red/off, true = green/on |
jsmith352 | 0:96656a61e4e3 | 49 | // 4x4 squares |
jsmith352 | 0:96656a61e4e3 | 50 | void smallSquare0(); |
jsmith352 | 0:96656a61e4e3 | 51 | void smallSquare1(); |
jsmith352 | 0:96656a61e4e3 | 52 | void smallSquare2(); |
jsmith352 | 0:96656a61e4e3 | 53 | void smallSquare3(); |
jsmith352 | 0:96656a61e4e3 | 54 | void smallSquare4(); |
jsmith352 | 0:96656a61e4e3 | 55 | void smallSquare5(); |
jsmith352 | 0:96656a61e4e3 | 56 | void smallSquare6(); |
jsmith352 | 0:96656a61e4e3 | 57 | void smallSquare7(); |
jsmith352 | 0:96656a61e4e3 | 58 | void smallSquare8(); |
jsmith352 | 0:96656a61e4e3 | 59 | void smallSquare9(); |
jsmith352 | 0:96656a61e4e3 | 60 | void smallSquare10(); |
jsmith352 | 0:96656a61e4e3 | 61 | void smallSquare11(); |
jsmith352 | 0:96656a61e4e3 | 62 | void smallSquare12(); |
jsmith352 | 0:96656a61e4e3 | 63 | void smallSquare13(); |
jsmith352 | 0:96656a61e4e3 | 64 | void smallSquare14(); |
jsmith352 | 0:96656a61e4e3 | 65 | void smallSquare15(); |
jsmith352 | 0:96656a61e4e3 | 66 | bool smallSquares[16]; // false = red/off, true = green/on |
jsmith352 | 0:96656a61e4e3 | 67 | |
jsmith352 | 0:96656a61e4e3 | 68 | }; |
jsmith352 | 0:96656a61e4e3 | 69 | #endif |