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.

Revision:
23:cbfa9d1ee3db
Parent:
22:403759d2f093
Child:
25:a7c89c54454a
--- a/main.cpp	Wed Jun 03 16:44:09 2020 +0000
+++ b/main.cpp	Wed Jun 03 19:52:59 2020 +0000
@@ -61,7 +61,7 @@
 
     render(); // draw initial frame
     wait(1.0f/fps); // wait one frame period
-    
+
     set_values();
 
 // game loop
@@ -72,6 +72,7 @@
         lcd.refresh();
         lcd.clear();
         tetris.fallenblocks(lcd, iH);
+        tetris.clearline(lcd, iB);
         tetris.draw(lcd); // re-draw
         if (tetris.floor_hit_flag==1) {
             tetris.fallenblocks(lcd, iH);
@@ -80,15 +81,13 @@
             tetris.Y[iH] = tetris.b;
             tetris.floor_hit_flag = 0;
             printf("iH increased\n");
-        }
-        else if (tetris.clear_line_flag==1) {
-            tetris.clearline(lcd, iB);
+        } else if (tetris.clear_line_flag==1) {
             iB++;
             tetris.Z[iB] = tetris.c;
+            tetris.Q[iB] = tetris.d;
             tetris.clear_line_flag==0;
             printf("iB increased\n");
         }
-        else if (tetris.
         wait(1.0f/fps); // wait one frame period
     }
 }
@@ -108,9 +107,9 @@
 void set_values()
 {
     for(int i=0; i<=50; i++) {
-    tetris.X[i]=0;
-    tetris.Y[i]=0;
-}
+        tetris.X[i]=0;
+        tetris.Y[i]=0;
+    }
 }
 
 void render()   // draws each frame on the lcd