![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
All there but errors need fixing
Dependencies: mbed
Overview:
Rookie Tetris is a jigsaw style game based on the classic Tetris.
A block will appear at the top of the screen, you must move it (your options for movement are left, right and down - you cannot move up the board). The block will stop when it if placed either on the floor of the board or on-top of another block.
Your goal is to fill a complete row of the board with the blocks; when you do so the row will delete and the pattern above it will drop down. The game is over when your pattern is tall enough to reach to the top of the board!
Controls:
Use the joystick to move your block! Your block cannot move out of the parameters of the board.
Pot 2 controls the contrast of the screen.
Diff: Tetromino/Tetromino.cpp
- Revision:
- 19:2ad31dbd5d11
- Parent:
- 17:70d45e9e44a8
- Child:
- 20:ad685b35a1a4
diff -r a089d9d184b1 -r 2ad31dbd5d11 Tetromino/Tetromino.cpp --- a/Tetromino/Tetromino.cpp Wed Jun 03 10:32:48 2020 +0000 +++ b/Tetromino/Tetromino.cpp Wed Jun 03 12:14:47 2020 +0000 @@ -47,14 +47,16 @@ // printf("d = %i, x = %i, y = %i, speed = %i\n",d,_x,_y,_speed); } - if (_x < 1) { - _x = 1; + if (_x < 20) { + _x = 20; + printf("left wall hit\n"); } - if (_x > WIDTH - 1) { - _x = WIDTH - 1; + else if (_x > 56) { + _x = 56; + printf("right wall hit\n"); } - printf("back corner of block = (%i,%i)\n",_x,_y); - printf("front corner of block = (%i, %i)\n",_x+3,_y+3); +// printf("back corner of block = (%i,%i)\n",_x,_y); +// printf("front corner of block = (%i, %i)\n",_x+3,_y+3); } /*void Tetromino::set_velocity(Vector2D v)