Tetris game on mikroTFT touchscreen and LPC1768

Dependencies:   Tetris

Dependents:   Tetris

Revision:
0:645509d95b8d
Child:
1:b4aa36ae11ac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Feb 20 14:14:30 2017 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+#include <ctime>
+#include "playGround.h"
+#include "Block.h"
+
+#define SPEED 10
+
+int main()
+{
+    int flag;
+    clock_t start_s;
+    TFTInit();
+    drawMap();
+    while (1) {
+        Block NewBlock;
+        flag = 0;
+        drawMap();
+        while(flag == 0) {
+            drawMap();
+            drawBlock(NewBlock);
+            start_s =clock();
+            while( start_s + SPEED > clock() ) {
+            }
+            if ( NewBlock.CheckBottom() ) {
+                saveToField(NewBlock);
+                flag = 1;
+            } else {
+                clrBlock(NewBlock);
+                NewBlock.y += 1;
+            }
+        }
+    }
+}
\ No newline at end of file