Tetris game on mikroTFT touchscreen and LPC1768
Diff: Block.cpp
- Revision:
- 3:36de55e63fdf
- Parent:
- 2:6b6986c3d2bd
- Child:
- 4:107d1d5a642e
--- a/Block.cpp Fri Mar 03 13:19:26 2017 +0000 +++ b/Block.cpp Sat Mar 11 19:50:03 2017 +0000 @@ -31,7 +31,7 @@ void Block::rotateRight() { - if ( !CheckRotateLeft() ) { + if ( !CheckRotateRight() ) { if ( angle == 3 ) angle = 0; else @@ -60,7 +60,7 @@ && (Field[y + yy - 1][x + xx - 2] != 0) && ( y + yy - 1 > 0 ) ) return 1; - if ( (Piece[form][angle][xx][yy] != 0) && ( yy + y == 13 ) ) + if ( (Piece[form][angle][xx][yy] != 0) && ( yy + y == MAXY + 1 ) ) return 1; } } @@ -92,7 +92,7 @@ && (Field[y + yy - 2][x + xx - 1] != 0) && ( y + yy - 3 > 0 ) ) return 1; - if ( (Piece[form][angle][xx][yy] != 0) && ( xx + x == 11 ) ) + if ( (Piece[form][angle][xx][yy] != 0) && ( xx + x == MAXX + 1 ) ) return 1; } } @@ -108,7 +108,7 @@ && (Field[y + yy - 1][x + xx - 2] != 0) && ( y + yy - 3 > 0 ) ) return 1; - if ( (Piece[form][( abs(angle + 1) ) % 4][xx][yy] != 0) && (( xx + x == 1 ) || ( xx + x == 11 )) ) + if ( (Piece[form][( abs(angle + 1) ) % 4][xx][yy] != 0) && (( xx + x == 1 ) || ( xx + x == MAXX + 1 )) ) return 1; } } @@ -124,7 +124,7 @@ && (Field[y + yy - 1][x + xx - 2] != 0) && ( y + yy - 3 > 0 ) ) return 1; - if ( (Piece[form][( abs(angle + 1) ) % 4][xx][yy] != 0) && (( xx + x == 1 ) || ( xx + x == 12 )) ) + if ( (Piece[form][( abs(angle + 1) ) % 4][xx][yy] != 0) && (( xx + x == 1 ) || ( xx + x == MAXX + 2 )) ) return 1; } }