Flip tile pattern game
Dependencies: 4DGL-uLCD-SE PinDetect SDFileSystem mbed-rtos mbed wave_player
tile.cpp@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 | #include "tile.h" |
jsmith352 | 0:96656a61e4e3 | 2 | |
jsmith352 | 0:96656a61e4e3 | 3 | // constructors |
jsmith352 | 0:96656a61e4e3 | 4 | |
jsmith352 | 0:96656a61e4e3 | 5 | Tile::Tile(PinName pin1, PinName pin2, PinName pin3){ |
jsmith352 | 0:96656a61e4e3 | 6 | LCD_ptr = new uLCD_4DGL(pin1, pin2, pin3); |
jsmith352 | 0:96656a61e4e3 | 7 | setup = false; |
jsmith352 | 0:96656a61e4e3 | 8 | score = 0; |
jsmith352 | 0:96656a61e4e3 | 9 | win = false; |
jsmith352 | 0:96656a61e4e3 | 10 | } |
jsmith352 | 0:96656a61e4e3 | 11 | |
jsmith352 | 0:96656a61e4e3 | 12 | // member functions |
jsmith352 | 0:96656a61e4e3 | 13 | void Tile::TilePattern3(int square){ |
jsmith352 | 0:96656a61e4e3 | 14 | int i = 0; |
jsmith352 | 0:96656a61e4e3 | 15 | int j = 0; |
jsmith352 | 0:96656a61e4e3 | 16 | switch(square){ |
jsmith352 | 0:96656a61e4e3 | 17 | case 0: |
jsmith352 | 0:96656a61e4e3 | 18 | square0(); |
jsmith352 | 0:96656a61e4e3 | 19 | square1(); |
jsmith352 | 0:96656a61e4e3 | 20 | square3(); |
jsmith352 | 0:96656a61e4e3 | 21 | break; |
jsmith352 | 0:96656a61e4e3 | 22 | case 1: |
jsmith352 | 0:96656a61e4e3 | 23 | square0(); |
jsmith352 | 0:96656a61e4e3 | 24 | square1(); |
jsmith352 | 0:96656a61e4e3 | 25 | square2(); |
jsmith352 | 0:96656a61e4e3 | 26 | square4(); |
jsmith352 | 0:96656a61e4e3 | 27 | break; |
jsmith352 | 0:96656a61e4e3 | 28 | case 2: |
jsmith352 | 0:96656a61e4e3 | 29 | square1(); |
jsmith352 | 0:96656a61e4e3 | 30 | square2(); |
jsmith352 | 0:96656a61e4e3 | 31 | square5(); |
jsmith352 | 0:96656a61e4e3 | 32 | break; |
jsmith352 | 0:96656a61e4e3 | 33 | case 3: |
jsmith352 | 0:96656a61e4e3 | 34 | square0(); |
jsmith352 | 0:96656a61e4e3 | 35 | square3(); |
jsmith352 | 0:96656a61e4e3 | 36 | square4(); |
jsmith352 | 0:96656a61e4e3 | 37 | square6(); |
jsmith352 | 0:96656a61e4e3 | 38 | break; |
jsmith352 | 0:96656a61e4e3 | 39 | case 4: |
jsmith352 | 0:96656a61e4e3 | 40 | square1(); |
jsmith352 | 0:96656a61e4e3 | 41 | square3(); |
jsmith352 | 0:96656a61e4e3 | 42 | square4(); |
jsmith352 | 0:96656a61e4e3 | 43 | square5(); |
jsmith352 | 0:96656a61e4e3 | 44 | square7(); |
jsmith352 | 0:96656a61e4e3 | 45 | break; |
jsmith352 | 0:96656a61e4e3 | 46 | case 5: |
jsmith352 | 0:96656a61e4e3 | 47 | square2(); |
jsmith352 | 0:96656a61e4e3 | 48 | square4(); |
jsmith352 | 0:96656a61e4e3 | 49 | square5(); |
jsmith352 | 0:96656a61e4e3 | 50 | square8(); |
jsmith352 | 0:96656a61e4e3 | 51 | break; |
jsmith352 | 0:96656a61e4e3 | 52 | case 6: |
jsmith352 | 0:96656a61e4e3 | 53 | square3(); |
jsmith352 | 0:96656a61e4e3 | 54 | square6(); |
jsmith352 | 0:96656a61e4e3 | 55 | square7(); |
jsmith352 | 0:96656a61e4e3 | 56 | break; |
jsmith352 | 0:96656a61e4e3 | 57 | case 7: |
jsmith352 | 0:96656a61e4e3 | 58 | square4(); |
jsmith352 | 0:96656a61e4e3 | 59 | square6(); |
jsmith352 | 0:96656a61e4e3 | 60 | square7(); |
jsmith352 | 0:96656a61e4e3 | 61 | square8(); |
jsmith352 | 0:96656a61e4e3 | 62 | break; |
jsmith352 | 0:96656a61e4e3 | 63 | case 8: |
jsmith352 | 0:96656a61e4e3 | 64 | square5(); |
jsmith352 | 0:96656a61e4e3 | 65 | square7(); |
jsmith352 | 0:96656a61e4e3 | 66 | square8(); |
jsmith352 | 0:96656a61e4e3 | 67 | break; |
jsmith352 | 0:96656a61e4e3 | 68 | default: |
jsmith352 | 0:96656a61e4e3 | 69 | break; |
jsmith352 | 0:96656a61e4e3 | 70 | } |
jsmith352 | 0:96656a61e4e3 | 71 | score++; |
jsmith352 | 0:96656a61e4e3 | 72 | for(i = 0; i < 9; i++){ |
jsmith352 | 0:96656a61e4e3 | 73 | if(squares[i] == true) |
jsmith352 | 0:96656a61e4e3 | 74 | j++; |
jsmith352 | 0:96656a61e4e3 | 75 | } |
jsmith352 | 0:96656a61e4e3 | 76 | if(j == 9){ |
jsmith352 | 0:96656a61e4e3 | 77 | win = true; |
jsmith352 | 0:96656a61e4e3 | 78 | } |
jsmith352 | 0:96656a61e4e3 | 79 | } |
jsmith352 | 0:96656a61e4e3 | 80 | |
jsmith352 | 0:96656a61e4e3 | 81 | void Tile::TilePattern4(int square){ |
jsmith352 | 0:96656a61e4e3 | 82 | int i = 0; |
jsmith352 | 0:96656a61e4e3 | 83 | int j = 0; |
jsmith352 | 0:96656a61e4e3 | 84 | switch(square){ |
jsmith352 | 0:96656a61e4e3 | 85 | case 0: |
jsmith352 | 0:96656a61e4e3 | 86 | smallSquare0(); |
jsmith352 | 0:96656a61e4e3 | 87 | smallSquare1(); |
jsmith352 | 0:96656a61e4e3 | 88 | smallSquare4(); |
jsmith352 | 0:96656a61e4e3 | 89 | break; |
jsmith352 | 0:96656a61e4e3 | 90 | case 1: |
jsmith352 | 0:96656a61e4e3 | 91 | smallSquare0(); |
jsmith352 | 0:96656a61e4e3 | 92 | smallSquare1(); |
jsmith352 | 0:96656a61e4e3 | 93 | smallSquare2(); |
jsmith352 | 0:96656a61e4e3 | 94 | smallSquare5(); |
jsmith352 | 0:96656a61e4e3 | 95 | break; |
jsmith352 | 0:96656a61e4e3 | 96 | case 2: |
jsmith352 | 0:96656a61e4e3 | 97 | smallSquare1(); |
jsmith352 | 0:96656a61e4e3 | 98 | smallSquare2(); |
jsmith352 | 0:96656a61e4e3 | 99 | smallSquare3(); |
jsmith352 | 0:96656a61e4e3 | 100 | smallSquare6(); |
jsmith352 | 0:96656a61e4e3 | 101 | break; |
jsmith352 | 0:96656a61e4e3 | 102 | case 3: |
jsmith352 | 0:96656a61e4e3 | 103 | smallSquare2(); |
jsmith352 | 0:96656a61e4e3 | 104 | smallSquare3(); |
jsmith352 | 0:96656a61e4e3 | 105 | smallSquare7(); |
jsmith352 | 0:96656a61e4e3 | 106 | break; |
jsmith352 | 0:96656a61e4e3 | 107 | case 4: |
jsmith352 | 0:96656a61e4e3 | 108 | smallSquare0(); |
jsmith352 | 0:96656a61e4e3 | 109 | smallSquare4(); |
jsmith352 | 0:96656a61e4e3 | 110 | smallSquare5(); |
jsmith352 | 0:96656a61e4e3 | 111 | smallSquare8(); |
jsmith352 | 0:96656a61e4e3 | 112 | break; |
jsmith352 | 0:96656a61e4e3 | 113 | case 5: |
jsmith352 | 0:96656a61e4e3 | 114 | smallSquare1(); |
jsmith352 | 0:96656a61e4e3 | 115 | smallSquare4(); |
jsmith352 | 0:96656a61e4e3 | 116 | smallSquare5(); |
jsmith352 | 0:96656a61e4e3 | 117 | smallSquare6(); |
jsmith352 | 0:96656a61e4e3 | 118 | smallSquare9(); |
jsmith352 | 0:96656a61e4e3 | 119 | break; |
jsmith352 | 0:96656a61e4e3 | 120 | case 6: |
jsmith352 | 0:96656a61e4e3 | 121 | smallSquare2(); |
jsmith352 | 0:96656a61e4e3 | 122 | smallSquare5(); |
jsmith352 | 0:96656a61e4e3 | 123 | smallSquare6(); |
jsmith352 | 0:96656a61e4e3 | 124 | smallSquare7(); |
jsmith352 | 0:96656a61e4e3 | 125 | smallSquare10(); |
jsmith352 | 0:96656a61e4e3 | 126 | break; |
jsmith352 | 0:96656a61e4e3 | 127 | case 7: |
jsmith352 | 0:96656a61e4e3 | 128 | smallSquare3(); |
jsmith352 | 0:96656a61e4e3 | 129 | smallSquare6(); |
jsmith352 | 0:96656a61e4e3 | 130 | smallSquare7(); |
jsmith352 | 0:96656a61e4e3 | 131 | smallSquare11(); |
jsmith352 | 0:96656a61e4e3 | 132 | break; |
jsmith352 | 0:96656a61e4e3 | 133 | case 8: |
jsmith352 | 0:96656a61e4e3 | 134 | smallSquare4(); |
jsmith352 | 0:96656a61e4e3 | 135 | smallSquare8(); |
jsmith352 | 0:96656a61e4e3 | 136 | smallSquare9(); |
jsmith352 | 0:96656a61e4e3 | 137 | smallSquare12(); |
jsmith352 | 0:96656a61e4e3 | 138 | break; |
jsmith352 | 0:96656a61e4e3 | 139 | case 9: |
jsmith352 | 0:96656a61e4e3 | 140 | smallSquare5(); |
jsmith352 | 0:96656a61e4e3 | 141 | smallSquare8(); |
jsmith352 | 0:96656a61e4e3 | 142 | smallSquare9(); |
jsmith352 | 0:96656a61e4e3 | 143 | smallSquare10(); |
jsmith352 | 0:96656a61e4e3 | 144 | smallSquare13(); |
jsmith352 | 0:96656a61e4e3 | 145 | break; |
jsmith352 | 0:96656a61e4e3 | 146 | case 10: |
jsmith352 | 0:96656a61e4e3 | 147 | smallSquare6(); |
jsmith352 | 0:96656a61e4e3 | 148 | smallSquare9(); |
jsmith352 | 0:96656a61e4e3 | 149 | smallSquare10(); |
jsmith352 | 0:96656a61e4e3 | 150 | smallSquare11(); |
jsmith352 | 0:96656a61e4e3 | 151 | smallSquare14(); |
jsmith352 | 0:96656a61e4e3 | 152 | break; |
jsmith352 | 0:96656a61e4e3 | 153 | case 11: |
jsmith352 | 0:96656a61e4e3 | 154 | smallSquare7(); |
jsmith352 | 0:96656a61e4e3 | 155 | smallSquare10(); |
jsmith352 | 0:96656a61e4e3 | 156 | smallSquare11(); |
jsmith352 | 0:96656a61e4e3 | 157 | smallSquare15(); |
jsmith352 | 0:96656a61e4e3 | 158 | break; |
jsmith352 | 0:96656a61e4e3 | 159 | case 12: |
jsmith352 | 0:96656a61e4e3 | 160 | smallSquare8(); |
jsmith352 | 0:96656a61e4e3 | 161 | smallSquare12(); |
jsmith352 | 0:96656a61e4e3 | 162 | smallSquare13(); |
jsmith352 | 0:96656a61e4e3 | 163 | break; |
jsmith352 | 0:96656a61e4e3 | 164 | case 13: |
jsmith352 | 0:96656a61e4e3 | 165 | smallSquare9(); |
jsmith352 | 0:96656a61e4e3 | 166 | smallSquare12(); |
jsmith352 | 0:96656a61e4e3 | 167 | smallSquare13(); |
jsmith352 | 0:96656a61e4e3 | 168 | smallSquare14(); |
jsmith352 | 0:96656a61e4e3 | 169 | break; |
jsmith352 | 0:96656a61e4e3 | 170 | case 14: |
jsmith352 | 0:96656a61e4e3 | 171 | smallSquare10(); |
jsmith352 | 0:96656a61e4e3 | 172 | smallSquare13(); |
jsmith352 | 0:96656a61e4e3 | 173 | smallSquare14(); |
jsmith352 | 0:96656a61e4e3 | 174 | smallSquare15(); |
jsmith352 | 0:96656a61e4e3 | 175 | break; |
jsmith352 | 0:96656a61e4e3 | 176 | case 15: |
jsmith352 | 0:96656a61e4e3 | 177 | smallSquare11(); |
jsmith352 | 0:96656a61e4e3 | 178 | smallSquare14(); |
jsmith352 | 0:96656a61e4e3 | 179 | smallSquare15(); |
jsmith352 | 0:96656a61e4e3 | 180 | break; |
jsmith352 | 0:96656a61e4e3 | 181 | default: |
jsmith352 | 0:96656a61e4e3 | 182 | break; |
jsmith352 | 0:96656a61e4e3 | 183 | } |
jsmith352 | 0:96656a61e4e3 | 184 | score++; |
jsmith352 | 0:96656a61e4e3 | 185 | for(i = 0; i < 16; i++){ |
jsmith352 | 0:96656a61e4e3 | 186 | if(smallSquares[i] == true) |
jsmith352 | 0:96656a61e4e3 | 187 | j++; |
jsmith352 | 0:96656a61e4e3 | 188 | } |
jsmith352 | 0:96656a61e4e3 | 189 | if(j == 16){ |
jsmith352 | 0:96656a61e4e3 | 190 | win = true; |
jsmith352 | 0:96656a61e4e3 | 191 | } |
jsmith352 | 0:96656a61e4e3 | 192 | } |
jsmith352 | 0:96656a61e4e3 | 193 | |
jsmith352 | 0:96656a61e4e3 | 194 | void Tile::TilePatternSetup(){ |
jsmith352 | 0:96656a61e4e3 | 195 | if(number_of_tiles == true){ // 3x3 |
jsmith352 | 0:96656a61e4e3 | 196 | square0(); |
jsmith352 | 0:96656a61e4e3 | 197 | square1(); |
jsmith352 | 0:96656a61e4e3 | 198 | square2(); |
jsmith352 | 0:96656a61e4e3 | 199 | square3(); |
jsmith352 | 0:96656a61e4e3 | 200 | square4(); |
jsmith352 | 0:96656a61e4e3 | 201 | square5(); |
jsmith352 | 0:96656a61e4e3 | 202 | square6(); |
jsmith352 | 0:96656a61e4e3 | 203 | square7(); |
jsmith352 | 0:96656a61e4e3 | 204 | square8(); |
jsmith352 | 0:96656a61e4e3 | 205 | } |
jsmith352 | 0:96656a61e4e3 | 206 | if(number_of_tiles == false){ // 4x4 |
jsmith352 | 0:96656a61e4e3 | 207 | smallSquare0(); |
jsmith352 | 0:96656a61e4e3 | 208 | smallSquare1(); |
jsmith352 | 0:96656a61e4e3 | 209 | smallSquare2(); |
jsmith352 | 0:96656a61e4e3 | 210 | smallSquare3(); |
jsmith352 | 0:96656a61e4e3 | 211 | smallSquare4(); |
jsmith352 | 0:96656a61e4e3 | 212 | smallSquare5(); |
jsmith352 | 0:96656a61e4e3 | 213 | smallSquare6(); |
jsmith352 | 0:96656a61e4e3 | 214 | smallSquare7(); |
jsmith352 | 0:96656a61e4e3 | 215 | smallSquare8(); |
jsmith352 | 0:96656a61e4e3 | 216 | smallSquare9(); |
jsmith352 | 0:96656a61e4e3 | 217 | smallSquare10(); |
jsmith352 | 0:96656a61e4e3 | 218 | smallSquare11(); |
jsmith352 | 0:96656a61e4e3 | 219 | smallSquare12(); |
jsmith352 | 0:96656a61e4e3 | 220 | smallSquare13(); |
jsmith352 | 0:96656a61e4e3 | 221 | smallSquare14(); |
jsmith352 | 0:96656a61e4e3 | 222 | smallSquare15(); |
jsmith352 | 0:96656a61e4e3 | 223 | } |
jsmith352 | 0:96656a61e4e3 | 224 | setup = true; |
jsmith352 | 0:96656a61e4e3 | 225 | } |
jsmith352 | 0:96656a61e4e3 | 226 | |
jsmith352 | 0:96656a61e4e3 | 227 | void Tile::setNumberOfTiles(bool size){ |
jsmith352 | 0:96656a61e4e3 | 228 | number_of_tiles = size; |
jsmith352 | 0:96656a61e4e3 | 229 | } |
jsmith352 | 0:96656a61e4e3 | 230 | |
jsmith352 | 0:96656a61e4e3 | 231 | int Tile::getScore(){ |
jsmith352 | 0:96656a61e4e3 | 232 | return(score); |
jsmith352 | 0:96656a61e4e3 | 233 | } |
jsmith352 | 0:96656a61e4e3 | 234 | |
jsmith352 | 0:96656a61e4e3 | 235 | void Tile::resetScore(){ |
jsmith352 | 0:96656a61e4e3 | 236 | score = 0; |
jsmith352 | 0:96656a61e4e3 | 237 | } |
jsmith352 | 0:96656a61e4e3 | 238 | |
jsmith352 | 0:96656a61e4e3 | 239 | void Tile::reset(){ |
jsmith352 | 0:96656a61e4e3 | 240 | resetScore(); |
jsmith352 | 0:96656a61e4e3 | 241 | win = false; |
jsmith352 | 0:96656a61e4e3 | 242 | setup = false; |
jsmith352 | 0:96656a61e4e3 | 243 | TilePatternSetup(); |
jsmith352 | 0:96656a61e4e3 | 244 | } |
jsmith352 | 0:96656a61e4e3 | 245 | |
jsmith352 | 0:96656a61e4e3 | 246 | void Tile::pause(){ |
jsmith352 | 0:96656a61e4e3 | 247 | int i = 0; |
jsmith352 | 0:96656a61e4e3 | 248 | if(number_of_tiles == true){ // 3x3 |
jsmith352 | 0:96656a61e4e3 | 249 | for(i = 0; i < 9; i++) |
jsmith352 | 0:96656a61e4e3 | 250 | squares[i] = !squares[i]; |
jsmith352 | 0:96656a61e4e3 | 251 | } |
jsmith352 | 0:96656a61e4e3 | 252 | else{ |
jsmith352 | 0:96656a61e4e3 | 253 | for(i = 0; i < 16; i++) |
jsmith352 | 0:96656a61e4e3 | 254 | smallSquares[i] = !smallSquares[i]; |
jsmith352 | 0:96656a61e4e3 | 255 | } |
jsmith352 | 0:96656a61e4e3 | 256 | } |
jsmith352 | 0:96656a61e4e3 | 257 | |
jsmith352 | 0:96656a61e4e3 | 258 | void Tile::unpause(){ |
jsmith352 | 0:96656a61e4e3 | 259 | if(number_of_tiles == true){ |
jsmith352 | 0:96656a61e4e3 | 260 | square0(); |
jsmith352 | 0:96656a61e4e3 | 261 | square1(); |
jsmith352 | 0:96656a61e4e3 | 262 | square2(); |
jsmith352 | 0:96656a61e4e3 | 263 | square3(); |
jsmith352 | 0:96656a61e4e3 | 264 | square4(); |
jsmith352 | 0:96656a61e4e3 | 265 | square5(); |
jsmith352 | 0:96656a61e4e3 | 266 | square6(); |
jsmith352 | 0:96656a61e4e3 | 267 | square7(); |
jsmith352 | 0:96656a61e4e3 | 268 | square8(); |
jsmith352 | 0:96656a61e4e3 | 269 | } |
jsmith352 | 0:96656a61e4e3 | 270 | else{ |
jsmith352 | 0:96656a61e4e3 | 271 | smallSquare0(); |
jsmith352 | 0:96656a61e4e3 | 272 | smallSquare1(); |
jsmith352 | 0:96656a61e4e3 | 273 | smallSquare2(); |
jsmith352 | 0:96656a61e4e3 | 274 | smallSquare3(); |
jsmith352 | 0:96656a61e4e3 | 275 | smallSquare4(); |
jsmith352 | 0:96656a61e4e3 | 276 | smallSquare5(); |
jsmith352 | 0:96656a61e4e3 | 277 | smallSquare6(); |
jsmith352 | 0:96656a61e4e3 | 278 | smallSquare7(); |
jsmith352 | 0:96656a61e4e3 | 279 | smallSquare8(); |
jsmith352 | 0:96656a61e4e3 | 280 | smallSquare9(); |
jsmith352 | 0:96656a61e4e3 | 281 | smallSquare10(); |
jsmith352 | 0:96656a61e4e3 | 282 | smallSquare11(); |
jsmith352 | 0:96656a61e4e3 | 283 | smallSquare12(); |
jsmith352 | 0:96656a61e4e3 | 284 | smallSquare13(); |
jsmith352 | 0:96656a61e4e3 | 285 | smallSquare14(); |
jsmith352 | 0:96656a61e4e3 | 286 | smallSquare15(); |
jsmith352 | 0:96656a61e4e3 | 287 | } |
jsmith352 | 0:96656a61e4e3 | 288 | } |
jsmith352 | 0:96656a61e4e3 | 289 | |
jsmith352 | 0:96656a61e4e3 | 290 | bool Tile::drawCursor(int position){ |
jsmith352 | 0:96656a61e4e3 | 291 | if(number_of_tiles == true) |
jsmith352 | 0:96656a61e4e3 | 292 | return(squares[position]); |
jsmith352 | 0:96656a61e4e3 | 293 | else |
jsmith352 | 0:96656a61e4e3 | 294 | return(smallSquares[position]); |
jsmith352 | 0:96656a61e4e3 | 295 | } //return false for red, true for green |
jsmith352 | 0:96656a61e4e3 | 296 | |
jsmith352 | 0:96656a61e4e3 | 297 | // *************************************** // |
jsmith352 | 0:96656a61e4e3 | 298 | // 3x3 SQUARES |
jsmith352 | 0:96656a61e4e3 | 299 | // *************************************** // |
jsmith352 | 0:96656a61e4e3 | 300 | |
jsmith352 | 0:96656a61e4e3 | 301 | // SQUARE 0 |
jsmith352 | 0:96656a61e4e3 | 302 | void Tile::square0(){ |
jsmith352 | 0:96656a61e4e3 | 303 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 304 | case false: |
jsmith352 | 0:96656a61e4e3 | 305 | LCD_ptr->filled_rectangle(87, 0, 127, 41, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 306 | squares[0] = false; |
jsmith352 | 0:96656a61e4e3 | 307 | break; |
jsmith352 | 0:96656a61e4e3 | 308 | case true: |
jsmith352 | 0:96656a61e4e3 | 309 | squares[0] = !squares[0]; |
jsmith352 | 0:96656a61e4e3 | 310 | if(squares[0] == true) |
jsmith352 | 0:96656a61e4e3 | 311 | LCD_ptr->filled_rectangle(87, 0, 127, 41, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 312 | else |
jsmith352 | 0:96656a61e4e3 | 313 | LCD_ptr->filled_rectangle(87, 0, 127, 41, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 314 | break; |
jsmith352 | 0:96656a61e4e3 | 315 | } |
jsmith352 | 0:96656a61e4e3 | 316 | } |
jsmith352 | 0:96656a61e4e3 | 317 | |
jsmith352 | 0:96656a61e4e3 | 318 | // SQUARE 1 |
jsmith352 | 0:96656a61e4e3 | 319 | void Tile::square1(){ |
jsmith352 | 0:96656a61e4e3 | 320 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 321 | case false: |
jsmith352 | 0:96656a61e4e3 | 322 | LCD_ptr->filled_rectangle(87, 44, 127, 85, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 323 | squares[1] = false; |
jsmith352 | 0:96656a61e4e3 | 324 | break; |
jsmith352 | 0:96656a61e4e3 | 325 | case true: |
jsmith352 | 0:96656a61e4e3 | 326 | squares[1] = !squares[1]; |
jsmith352 | 0:96656a61e4e3 | 327 | if(squares[1] == true) |
jsmith352 | 0:96656a61e4e3 | 328 | LCD_ptr->filled_rectangle(87, 44, 127, 85, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 329 | else |
jsmith352 | 0:96656a61e4e3 | 330 | LCD_ptr->filled_rectangle(87, 44, 127, 85, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 331 | break; |
jsmith352 | 0:96656a61e4e3 | 332 | } |
jsmith352 | 0:96656a61e4e3 | 333 | } |
jsmith352 | 0:96656a61e4e3 | 334 | |
jsmith352 | 0:96656a61e4e3 | 335 | //SQUARE 2 |
jsmith352 | 0:96656a61e4e3 | 336 | void Tile::square2(){ |
jsmith352 | 0:96656a61e4e3 | 337 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 338 | case false: |
jsmith352 | 0:96656a61e4e3 | 339 | LCD_ptr->filled_rectangle(87, 88, 127, 127, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 340 | squares[2] = false; |
jsmith352 | 0:96656a61e4e3 | 341 | break; |
jsmith352 | 0:96656a61e4e3 | 342 | case true: |
jsmith352 | 0:96656a61e4e3 | 343 | squares[2] = !squares[2]; |
jsmith352 | 0:96656a61e4e3 | 344 | if(squares[2] == true) |
jsmith352 | 0:96656a61e4e3 | 345 | LCD_ptr->filled_rectangle(87, 88, 127, 127, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 346 | else |
jsmith352 | 0:96656a61e4e3 | 347 | LCD_ptr->filled_rectangle(87, 88, 127, 127, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 348 | break; |
jsmith352 | 0:96656a61e4e3 | 349 | } |
jsmith352 | 0:96656a61e4e3 | 350 | } |
jsmith352 | 0:96656a61e4e3 | 351 | |
jsmith352 | 0:96656a61e4e3 | 352 | // SQUARE 3 |
jsmith352 | 0:96656a61e4e3 | 353 | void Tile::square3(){ |
jsmith352 | 0:96656a61e4e3 | 354 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 355 | case false: |
jsmith352 | 0:96656a61e4e3 | 356 | LCD_ptr->filled_rectangle(44, 0, 85, 41, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 357 | squares[3] = false; |
jsmith352 | 0:96656a61e4e3 | 358 | break; |
jsmith352 | 0:96656a61e4e3 | 359 | case true: |
jsmith352 | 0:96656a61e4e3 | 360 | squares[3] = !squares[3]; |
jsmith352 | 0:96656a61e4e3 | 361 | if(squares[3] == true) |
jsmith352 | 0:96656a61e4e3 | 362 | LCD_ptr->filled_rectangle(44, 0, 85, 41, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 363 | else |
jsmith352 | 0:96656a61e4e3 | 364 | LCD_ptr->filled_rectangle(44, 0, 85, 41, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 365 | break; |
jsmith352 | 0:96656a61e4e3 | 366 | } |
jsmith352 | 0:96656a61e4e3 | 367 | } |
jsmith352 | 0:96656a61e4e3 | 368 | |
jsmith352 | 0:96656a61e4e3 | 369 | // SQUARE 4 |
jsmith352 | 0:96656a61e4e3 | 370 | void Tile::square4(){ |
jsmith352 | 0:96656a61e4e3 | 371 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 372 | case false: |
jsmith352 | 0:96656a61e4e3 | 373 | LCD_ptr->filled_rectangle(44, 44, 85, 85, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 374 | squares[4] = false; |
jsmith352 | 0:96656a61e4e3 | 375 | break; |
jsmith352 | 0:96656a61e4e3 | 376 | case true: |
jsmith352 | 0:96656a61e4e3 | 377 | squares[4] = !squares[4]; |
jsmith352 | 0:96656a61e4e3 | 378 | if(squares[4] == true) |
jsmith352 | 0:96656a61e4e3 | 379 | LCD_ptr->filled_rectangle(44, 44, 85, 85, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 380 | else |
jsmith352 | 0:96656a61e4e3 | 381 | LCD_ptr->filled_rectangle(44, 44, 85, 85, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 382 | break; |
jsmith352 | 0:96656a61e4e3 | 383 | } |
jsmith352 | 0:96656a61e4e3 | 384 | } |
jsmith352 | 0:96656a61e4e3 | 385 | |
jsmith352 | 0:96656a61e4e3 | 386 | // SQUARE 5 |
jsmith352 | 0:96656a61e4e3 | 387 | void Tile::square5(){ |
jsmith352 | 0:96656a61e4e3 | 388 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 389 | case false: |
jsmith352 | 0:96656a61e4e3 | 390 | LCD_ptr->filled_rectangle(44, 88, 85, 127, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 391 | squares[5] = false; |
jsmith352 | 0:96656a61e4e3 | 392 | break; |
jsmith352 | 0:96656a61e4e3 | 393 | case true: |
jsmith352 | 0:96656a61e4e3 | 394 | squares[5] = !squares[5]; |
jsmith352 | 0:96656a61e4e3 | 395 | if(squares[5] == true) |
jsmith352 | 0:96656a61e4e3 | 396 | LCD_ptr->filled_rectangle(44, 88, 85, 127, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 397 | else |
jsmith352 | 0:96656a61e4e3 | 398 | LCD_ptr->filled_rectangle(44, 88, 85, 127, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 399 | break; |
jsmith352 | 0:96656a61e4e3 | 400 | } |
jsmith352 | 0:96656a61e4e3 | 401 | } |
jsmith352 | 0:96656a61e4e3 | 402 | |
jsmith352 | 0:96656a61e4e3 | 403 | // SQUARE 6 |
jsmith352 | 0:96656a61e4e3 | 404 | void Tile::square6(){ |
jsmith352 | 0:96656a61e4e3 | 405 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 406 | case false: |
jsmith352 | 0:96656a61e4e3 | 407 | LCD_ptr->filled_rectangle(0, 0, 41, 41, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 408 | squares[6] = false; |
jsmith352 | 0:96656a61e4e3 | 409 | break; |
jsmith352 | 0:96656a61e4e3 | 410 | case true: |
jsmith352 | 0:96656a61e4e3 | 411 | squares[6] = !squares[6]; |
jsmith352 | 0:96656a61e4e3 | 412 | if(squares[6] == true) |
jsmith352 | 0:96656a61e4e3 | 413 | LCD_ptr->filled_rectangle(0, 0, 41, 41, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 414 | else |
jsmith352 | 0:96656a61e4e3 | 415 | LCD_ptr->filled_rectangle(0, 0, 41, 41, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 416 | break; |
jsmith352 | 0:96656a61e4e3 | 417 | } |
jsmith352 | 0:96656a61e4e3 | 418 | } |
jsmith352 | 0:96656a61e4e3 | 419 | |
jsmith352 | 0:96656a61e4e3 | 420 | // SQUARE 7 |
jsmith352 | 0:96656a61e4e3 | 421 | void Tile::square7(){ |
jsmith352 | 0:96656a61e4e3 | 422 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 423 | case false: |
jsmith352 | 0:96656a61e4e3 | 424 | LCD_ptr->filled_rectangle(0, 44, 41, 85, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 425 | squares[7] = false; |
jsmith352 | 0:96656a61e4e3 | 426 | break; |
jsmith352 | 0:96656a61e4e3 | 427 | case true: |
jsmith352 | 0:96656a61e4e3 | 428 | squares[7] = !squares[7]; |
jsmith352 | 0:96656a61e4e3 | 429 | if(squares[7] == true) |
jsmith352 | 0:96656a61e4e3 | 430 | LCD_ptr->filled_rectangle(0, 44, 41, 85, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 431 | else |
jsmith352 | 0:96656a61e4e3 | 432 | LCD_ptr->filled_rectangle(0, 44, 41, 85, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 433 | break; |
jsmith352 | 0:96656a61e4e3 | 434 | } |
jsmith352 | 0:96656a61e4e3 | 435 | } |
jsmith352 | 0:96656a61e4e3 | 436 | |
jsmith352 | 0:96656a61e4e3 | 437 | // SQUARE 8 |
jsmith352 | 0:96656a61e4e3 | 438 | void Tile::square8(){ |
jsmith352 | 0:96656a61e4e3 | 439 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 440 | case false: |
jsmith352 | 0:96656a61e4e3 | 441 | LCD_ptr->filled_rectangle(0, 88, 41, 127, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 442 | squares[8] = false; |
jsmith352 | 0:96656a61e4e3 | 443 | break; |
jsmith352 | 0:96656a61e4e3 | 444 | case true: |
jsmith352 | 0:96656a61e4e3 | 445 | squares[8] = !squares[8]; |
jsmith352 | 0:96656a61e4e3 | 446 | if(squares[8] == true) |
jsmith352 | 0:96656a61e4e3 | 447 | LCD_ptr->filled_rectangle(0, 88, 41, 127, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 448 | else |
jsmith352 | 0:96656a61e4e3 | 449 | LCD_ptr->filled_rectangle(0, 88, 41, 127, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 450 | break; |
jsmith352 | 0:96656a61e4e3 | 451 | } |
jsmith352 | 0:96656a61e4e3 | 452 | } |
jsmith352 | 0:96656a61e4e3 | 453 | |
jsmith352 | 0:96656a61e4e3 | 454 | |
jsmith352 | 0:96656a61e4e3 | 455 | // *************************************** // |
jsmith352 | 0:96656a61e4e3 | 456 | // 4x4 SQUARES |
jsmith352 | 0:96656a61e4e3 | 457 | // *************************************** // |
jsmith352 | 0:96656a61e4e3 | 458 | |
jsmith352 | 0:96656a61e4e3 | 459 | // SQUARE 0 |
jsmith352 | 0:96656a61e4e3 | 460 | void Tile::smallSquare0(){ |
jsmith352 | 0:96656a61e4e3 | 461 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 462 | case false: |
jsmith352 | 0:96656a61e4e3 | 463 | LCD_ptr->filled_rectangle(96, 0, 126, 29, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 464 | smallSquares[0] = false; |
jsmith352 | 0:96656a61e4e3 | 465 | break; |
jsmith352 | 0:96656a61e4e3 | 466 | case true: |
jsmith352 | 0:96656a61e4e3 | 467 | smallSquares[0] = !smallSquares[0]; |
jsmith352 | 0:96656a61e4e3 | 468 | if(smallSquares[0] == true) |
jsmith352 | 0:96656a61e4e3 | 469 | LCD_ptr->filled_rectangle(96, 0, 126, 29, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 470 | else |
jsmith352 | 0:96656a61e4e3 | 471 | LCD_ptr->filled_rectangle(96, 0, 126, 29, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 472 | break; |
jsmith352 | 0:96656a61e4e3 | 473 | } |
jsmith352 | 0:96656a61e4e3 | 474 | } |
jsmith352 | 0:96656a61e4e3 | 475 | |
jsmith352 | 0:96656a61e4e3 | 476 | // SQUARE 1 |
jsmith352 | 0:96656a61e4e3 | 477 | void Tile::smallSquare1(){ |
jsmith352 | 0:96656a61e4e3 | 478 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 479 | case false: |
jsmith352 | 0:96656a61e4e3 | 480 | LCD_ptr->filled_rectangle(96, 32, 126, 61, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 481 | smallSquares[1] = false; |
jsmith352 | 0:96656a61e4e3 | 482 | break; |
jsmith352 | 0:96656a61e4e3 | 483 | case true: |
jsmith352 | 0:96656a61e4e3 | 484 | smallSquares[1] = !smallSquares[1]; |
jsmith352 | 0:96656a61e4e3 | 485 | if(smallSquares[1] == true) |
jsmith352 | 0:96656a61e4e3 | 486 | LCD_ptr->filled_rectangle(96, 32, 126, 61, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 487 | else |
jsmith352 | 0:96656a61e4e3 | 488 | LCD_ptr->filled_rectangle(96, 32, 126, 61, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 489 | break; |
jsmith352 | 0:96656a61e4e3 | 490 | } |
jsmith352 | 0:96656a61e4e3 | 491 | } |
jsmith352 | 0:96656a61e4e3 | 492 | |
jsmith352 | 0:96656a61e4e3 | 493 | // SQUARE 2 |
jsmith352 | 0:96656a61e4e3 | 494 | void Tile::smallSquare2(){ |
jsmith352 | 0:96656a61e4e3 | 495 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 496 | case false: |
jsmith352 | 0:96656a61e4e3 | 497 | LCD_ptr->filled_rectangle(96, 64, 126, 93, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 498 | smallSquares[2] = false; |
jsmith352 | 0:96656a61e4e3 | 499 | break; |
jsmith352 | 0:96656a61e4e3 | 500 | case true: |
jsmith352 | 0:96656a61e4e3 | 501 | smallSquares[2] = !smallSquares[2]; |
jsmith352 | 0:96656a61e4e3 | 502 | if(smallSquares[2] == true) |
jsmith352 | 0:96656a61e4e3 | 503 | LCD_ptr->filled_rectangle(96, 64, 126, 93, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 504 | else |
jsmith352 | 0:96656a61e4e3 | 505 | LCD_ptr->filled_rectangle(96, 64, 126, 93, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 506 | break; |
jsmith352 | 0:96656a61e4e3 | 507 | } |
jsmith352 | 0:96656a61e4e3 | 508 | } |
jsmith352 | 0:96656a61e4e3 | 509 | |
jsmith352 | 0:96656a61e4e3 | 510 | // SQUARE 3 |
jsmith352 | 0:96656a61e4e3 | 511 | void Tile::smallSquare3(){ |
jsmith352 | 0:96656a61e4e3 | 512 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 513 | case false: |
jsmith352 | 0:96656a61e4e3 | 514 | LCD_ptr->filled_rectangle(96, 96, 126, 126, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 515 | smallSquares[3] = false; |
jsmith352 | 0:96656a61e4e3 | 516 | break; |
jsmith352 | 0:96656a61e4e3 | 517 | case true: |
jsmith352 | 0:96656a61e4e3 | 518 | smallSquares[3] = !smallSquares[3]; |
jsmith352 | 0:96656a61e4e3 | 519 | if(smallSquares[3] == true) |
jsmith352 | 0:96656a61e4e3 | 520 | LCD_ptr->filled_rectangle(96, 96, 126, 126, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 521 | else |
jsmith352 | 0:96656a61e4e3 | 522 | LCD_ptr->filled_rectangle(96, 96, 126, 126, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 523 | break; |
jsmith352 | 0:96656a61e4e3 | 524 | } |
jsmith352 | 0:96656a61e4e3 | 525 | } |
jsmith352 | 0:96656a61e4e3 | 526 | |
jsmith352 | 0:96656a61e4e3 | 527 | // SQUARE 4 |
jsmith352 | 0:96656a61e4e3 | 528 | void Tile::smallSquare4(){ |
jsmith352 | 0:96656a61e4e3 | 529 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 530 | case false: |
jsmith352 | 0:96656a61e4e3 | 531 | LCD_ptr->filled_rectangle(64, 0, 93, 29, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 532 | smallSquares[4] = false; |
jsmith352 | 0:96656a61e4e3 | 533 | break; |
jsmith352 | 0:96656a61e4e3 | 534 | case true: |
jsmith352 | 0:96656a61e4e3 | 535 | smallSquares[4] = !smallSquares[4]; |
jsmith352 | 0:96656a61e4e3 | 536 | if(smallSquares[4] == true) |
jsmith352 | 0:96656a61e4e3 | 537 | LCD_ptr->filled_rectangle(64, 0, 93, 29, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 538 | else |
jsmith352 | 0:96656a61e4e3 | 539 | LCD_ptr->filled_rectangle(64, 0, 93, 29, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 540 | break; |
jsmith352 | 0:96656a61e4e3 | 541 | } |
jsmith352 | 0:96656a61e4e3 | 542 | } |
jsmith352 | 0:96656a61e4e3 | 543 | |
jsmith352 | 0:96656a61e4e3 | 544 | // SQUARE 5 |
jsmith352 | 0:96656a61e4e3 | 545 | void Tile::smallSquare5(){ |
jsmith352 | 0:96656a61e4e3 | 546 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 547 | case false: |
jsmith352 | 0:96656a61e4e3 | 548 | LCD_ptr->filled_rectangle(64, 32, 93, 61, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 549 | smallSquares[5] = false; |
jsmith352 | 0:96656a61e4e3 | 550 | break; |
jsmith352 | 0:96656a61e4e3 | 551 | case true: |
jsmith352 | 0:96656a61e4e3 | 552 | smallSquares[5] = !smallSquares[5]; |
jsmith352 | 0:96656a61e4e3 | 553 | if(smallSquares[5] == true) |
jsmith352 | 0:96656a61e4e3 | 554 | LCD_ptr->filled_rectangle(64, 32, 93, 61, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 555 | else |
jsmith352 | 0:96656a61e4e3 | 556 | LCD_ptr->filled_rectangle(64, 32, 93, 61, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 557 | break; |
jsmith352 | 0:96656a61e4e3 | 558 | } |
jsmith352 | 0:96656a61e4e3 | 559 | } |
jsmith352 | 0:96656a61e4e3 | 560 | |
jsmith352 | 0:96656a61e4e3 | 561 | // SQUARE 6 |
jsmith352 | 0:96656a61e4e3 | 562 | void Tile::smallSquare6(){ |
jsmith352 | 0:96656a61e4e3 | 563 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 564 | case false: |
jsmith352 | 0:96656a61e4e3 | 565 | LCD_ptr->filled_rectangle(64, 64, 93, 93, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 566 | smallSquares[6] = false; |
jsmith352 | 0:96656a61e4e3 | 567 | break; |
jsmith352 | 0:96656a61e4e3 | 568 | case true: |
jsmith352 | 0:96656a61e4e3 | 569 | smallSquares[6] = !smallSquares[6]; |
jsmith352 | 0:96656a61e4e3 | 570 | if(smallSquares[6] == true) |
jsmith352 | 0:96656a61e4e3 | 571 | LCD_ptr->filled_rectangle(64, 64, 93, 93, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 572 | else |
jsmith352 | 0:96656a61e4e3 | 573 | LCD_ptr->filled_rectangle(64, 64, 93, 93, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 574 | break; |
jsmith352 | 0:96656a61e4e3 | 575 | } |
jsmith352 | 0:96656a61e4e3 | 576 | } |
jsmith352 | 0:96656a61e4e3 | 577 | |
jsmith352 | 0:96656a61e4e3 | 578 | // SQUARE 7 |
jsmith352 | 0:96656a61e4e3 | 579 | void Tile::smallSquare7(){ |
jsmith352 | 0:96656a61e4e3 | 580 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 581 | case false: |
jsmith352 | 0:96656a61e4e3 | 582 | LCD_ptr->filled_rectangle(64, 96, 93, 126, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 583 | smallSquares[7] = false; |
jsmith352 | 0:96656a61e4e3 | 584 | break; |
jsmith352 | 0:96656a61e4e3 | 585 | case true: |
jsmith352 | 0:96656a61e4e3 | 586 | smallSquares[7] = !smallSquares[7]; |
jsmith352 | 0:96656a61e4e3 | 587 | if(smallSquares[7] == true) |
jsmith352 | 0:96656a61e4e3 | 588 | LCD_ptr->filled_rectangle(64, 96, 93, 126, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 589 | else |
jsmith352 | 0:96656a61e4e3 | 590 | LCD_ptr->filled_rectangle(64, 96, 93, 126, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 591 | break; |
jsmith352 | 0:96656a61e4e3 | 592 | } |
jsmith352 | 0:96656a61e4e3 | 593 | } |
jsmith352 | 0:96656a61e4e3 | 594 | |
jsmith352 | 0:96656a61e4e3 | 595 | // SQUARE 8 |
jsmith352 | 0:96656a61e4e3 | 596 | void Tile::smallSquare8(){ |
jsmith352 | 0:96656a61e4e3 | 597 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 598 | case false: |
jsmith352 | 0:96656a61e4e3 | 599 | LCD_ptr->filled_rectangle(32, 0, 61, 29, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 600 | smallSquares[8] = false; |
jsmith352 | 0:96656a61e4e3 | 601 | break; |
jsmith352 | 0:96656a61e4e3 | 602 | case true: |
jsmith352 | 0:96656a61e4e3 | 603 | smallSquares[8] = !smallSquares[8]; |
jsmith352 | 0:96656a61e4e3 | 604 | if(smallSquares[8] == true) |
jsmith352 | 0:96656a61e4e3 | 605 | LCD_ptr->filled_rectangle(32, 0, 61, 29, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 606 | else |
jsmith352 | 0:96656a61e4e3 | 607 | LCD_ptr->filled_rectangle(32, 0, 61, 29, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 608 | break; |
jsmith352 | 0:96656a61e4e3 | 609 | } |
jsmith352 | 0:96656a61e4e3 | 610 | } |
jsmith352 | 0:96656a61e4e3 | 611 | |
jsmith352 | 0:96656a61e4e3 | 612 | // SQUARE 9 |
jsmith352 | 0:96656a61e4e3 | 613 | void Tile::smallSquare9(){ |
jsmith352 | 0:96656a61e4e3 | 614 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 615 | case false: |
jsmith352 | 0:96656a61e4e3 | 616 | LCD_ptr->filled_rectangle(32, 32, 61, 61, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 617 | smallSquares[9] = false; |
jsmith352 | 0:96656a61e4e3 | 618 | break; |
jsmith352 | 0:96656a61e4e3 | 619 | case true: |
jsmith352 | 0:96656a61e4e3 | 620 | smallSquares[9] = !smallSquares[9]; |
jsmith352 | 0:96656a61e4e3 | 621 | if(smallSquares[9] == true) |
jsmith352 | 0:96656a61e4e3 | 622 | LCD_ptr->filled_rectangle(32, 32, 61, 61, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 623 | else |
jsmith352 | 0:96656a61e4e3 | 624 | LCD_ptr->filled_rectangle(32, 32, 61, 61, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 625 | break; |
jsmith352 | 0:96656a61e4e3 | 626 | } |
jsmith352 | 0:96656a61e4e3 | 627 | } |
jsmith352 | 0:96656a61e4e3 | 628 | |
jsmith352 | 0:96656a61e4e3 | 629 | // SQUARE 10 |
jsmith352 | 0:96656a61e4e3 | 630 | void Tile::smallSquare10(){ |
jsmith352 | 0:96656a61e4e3 | 631 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 632 | case false: |
jsmith352 | 0:96656a61e4e3 | 633 | LCD_ptr->filled_rectangle(32, 64, 61, 93, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 634 | smallSquares[10] = false; |
jsmith352 | 0:96656a61e4e3 | 635 | break; |
jsmith352 | 0:96656a61e4e3 | 636 | case true: |
jsmith352 | 0:96656a61e4e3 | 637 | smallSquares[10] = !smallSquares[10]; |
jsmith352 | 0:96656a61e4e3 | 638 | if(smallSquares[10] == true) |
jsmith352 | 0:96656a61e4e3 | 639 | LCD_ptr->filled_rectangle(32, 64, 61, 93, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 640 | else |
jsmith352 | 0:96656a61e4e3 | 641 | LCD_ptr->filled_rectangle(32, 64, 61, 93, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 642 | break; |
jsmith352 | 0:96656a61e4e3 | 643 | } |
jsmith352 | 0:96656a61e4e3 | 644 | } |
jsmith352 | 0:96656a61e4e3 | 645 | |
jsmith352 | 0:96656a61e4e3 | 646 | // SQUARE 11 |
jsmith352 | 0:96656a61e4e3 | 647 | void Tile::smallSquare11(){ |
jsmith352 | 0:96656a61e4e3 | 648 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 649 | case false: |
jsmith352 | 0:96656a61e4e3 | 650 | LCD_ptr->filled_rectangle(32, 96, 61, 126, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 651 | smallSquares[11] = false; |
jsmith352 | 0:96656a61e4e3 | 652 | break; |
jsmith352 | 0:96656a61e4e3 | 653 | case true: |
jsmith352 | 0:96656a61e4e3 | 654 | smallSquares[11] = !smallSquares[11]; |
jsmith352 | 0:96656a61e4e3 | 655 | if(smallSquares[11] == true) |
jsmith352 | 0:96656a61e4e3 | 656 | LCD_ptr->filled_rectangle(32, 96, 61, 126, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 657 | else |
jsmith352 | 0:96656a61e4e3 | 658 | LCD_ptr->filled_rectangle(32, 96, 61, 126, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 659 | break; |
jsmith352 | 0:96656a61e4e3 | 660 | } |
jsmith352 | 0:96656a61e4e3 | 661 | } |
jsmith352 | 0:96656a61e4e3 | 662 | |
jsmith352 | 0:96656a61e4e3 | 663 | // SQUARE 12 |
jsmith352 | 0:96656a61e4e3 | 664 | void Tile::smallSquare12(){ |
jsmith352 | 0:96656a61e4e3 | 665 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 666 | case false: |
jsmith352 | 0:96656a61e4e3 | 667 | LCD_ptr->filled_rectangle(0, 0, 29, 29, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 668 | smallSquares[12] = false; |
jsmith352 | 0:96656a61e4e3 | 669 | break; |
jsmith352 | 0:96656a61e4e3 | 670 | case true: |
jsmith352 | 0:96656a61e4e3 | 671 | smallSquares[12] = !smallSquares[12]; |
jsmith352 | 0:96656a61e4e3 | 672 | if(smallSquares[12] == true) |
jsmith352 | 0:96656a61e4e3 | 673 | LCD_ptr->filled_rectangle(0, 0, 29, 29, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 674 | else |
jsmith352 | 0:96656a61e4e3 | 675 | LCD_ptr->filled_rectangle(0, 0, 29, 29, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 676 | break; |
jsmith352 | 0:96656a61e4e3 | 677 | } |
jsmith352 | 0:96656a61e4e3 | 678 | } |
jsmith352 | 0:96656a61e4e3 | 679 | |
jsmith352 | 0:96656a61e4e3 | 680 | // SQUARE 13 |
jsmith352 | 0:96656a61e4e3 | 681 | void Tile::smallSquare13(){ |
jsmith352 | 0:96656a61e4e3 | 682 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 683 | case false: |
jsmith352 | 0:96656a61e4e3 | 684 | LCD_ptr->filled_rectangle(0, 32, 29, 61, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 685 | smallSquares[13] = false; |
jsmith352 | 0:96656a61e4e3 | 686 | break; |
jsmith352 | 0:96656a61e4e3 | 687 | case true: |
jsmith352 | 0:96656a61e4e3 | 688 | smallSquares[13] = !smallSquares[13]; |
jsmith352 | 0:96656a61e4e3 | 689 | if(smallSquares[13] == true) |
jsmith352 | 0:96656a61e4e3 | 690 | LCD_ptr->filled_rectangle(0, 32, 29, 61, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 691 | else |
jsmith352 | 0:96656a61e4e3 | 692 | LCD_ptr->filled_rectangle(0, 32, 29, 61, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 693 | break; |
jsmith352 | 0:96656a61e4e3 | 694 | } |
jsmith352 | 0:96656a61e4e3 | 695 | } |
jsmith352 | 0:96656a61e4e3 | 696 | |
jsmith352 | 0:96656a61e4e3 | 697 | // SQUARE 14 |
jsmith352 | 0:96656a61e4e3 | 698 | void Tile::smallSquare14(){ |
jsmith352 | 0:96656a61e4e3 | 699 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 700 | case false: |
jsmith352 | 0:96656a61e4e3 | 701 | LCD_ptr->filled_rectangle(0, 64, 29, 93, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 702 | smallSquares[14] = false; |
jsmith352 | 0:96656a61e4e3 | 703 | break; |
jsmith352 | 0:96656a61e4e3 | 704 | case true: |
jsmith352 | 0:96656a61e4e3 | 705 | smallSquares[14] = !smallSquares[14]; |
jsmith352 | 0:96656a61e4e3 | 706 | if(smallSquares[14] == true) |
jsmith352 | 0:96656a61e4e3 | 707 | LCD_ptr->filled_rectangle(0, 64, 29, 93, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 708 | else |
jsmith352 | 0:96656a61e4e3 | 709 | LCD_ptr->filled_rectangle(0, 64, 29, 93, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 710 | break; |
jsmith352 | 0:96656a61e4e3 | 711 | } |
jsmith352 | 0:96656a61e4e3 | 712 | } |
jsmith352 | 0:96656a61e4e3 | 713 | |
jsmith352 | 0:96656a61e4e3 | 714 | // SQUARE 15 |
jsmith352 | 0:96656a61e4e3 | 715 | void Tile::smallSquare15(){ |
jsmith352 | 0:96656a61e4e3 | 716 | switch(setup){ |
jsmith352 | 0:96656a61e4e3 | 717 | case false: |
jsmith352 | 0:96656a61e4e3 | 718 | LCD_ptr->filled_rectangle(0, 96, 29, 126, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 719 | smallSquares[15] = false; |
jsmith352 | 0:96656a61e4e3 | 720 | break; |
jsmith352 | 0:96656a61e4e3 | 721 | case true: |
jsmith352 | 0:96656a61e4e3 | 722 | smallSquares[15] = !smallSquares[15]; |
jsmith352 | 0:96656a61e4e3 | 723 | if(smallSquares[15] == true) |
jsmith352 | 0:96656a61e4e3 | 724 | LCD_ptr->filled_rectangle(0, 96, 29, 126, TILE_ON); |
jsmith352 | 0:96656a61e4e3 | 725 | else |
jsmith352 | 0:96656a61e4e3 | 726 | LCD_ptr->filled_rectangle(0, 96, 29, 126, TILE_OFF); |
jsmith352 | 0:96656a61e4e3 | 727 | break; |
jsmith352 | 0:96656a61e4e3 | 728 | } |
jsmith352 | 0:96656a61e4e3 | 729 | } |