![](/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: main.cpp
- Revision:
- 25:a7c89c54454a
- Parent:
- 23:cbfa9d1ee3db
--- a/main.cpp Wed Jun 03 20:09:57 2020 +0000 +++ b/main.cpp Wed Jun 03 22:26:13 2020 +0000 @@ -75,13 +75,13 @@ tetris.clearline(lcd, iB); tetris.draw(lcd); // re-draw if (tetris.floor_hit_flag==1) { - tetris.fallenblocks(lcd, iH); + tetris.fallenblocks(lcd, iH); // draw on old blocks iH++; tetris.X[iH] = tetris.a; tetris.Y[iH] = tetris.b; tetris.floor_hit_flag = 0; printf("iH increased\n"); - } else if (tetris.clear_line_flag==1) { + } else if (tetris.clear_line_flag==1) { // clear line and drop screen down iB++; tetris.Z[iB] = tetris.c; tetris.Q[iB] = tetris.d; @@ -125,11 +125,11 @@ void welcome() { - lcd.printString(" TETRIS ",0,1); + lcd.printString(" ROOKIE TETRIS",0,1); lcd.printString(" Press Start ",0,4); lcd.refresh(); - // flash LEDs untile start button pressed + // flash LEDs until start button pressed while (pad.start_pressed() == false) { lcd.setContrast(pad.read_pot1()); pad.leds_on();