Tetris for the RA8875, derived from another users implementation.

Dependencies:   RA8875

Fork of Tetris by Sergejs Popovs

Tetris, adapted to the RA8875 graphics library and display.

As currently implemented, this version is defined for the 800x480 display. A number of macros can adapt it for other screen resolutions.

Further, while presently configured for landscape mode, it should be fairly easy to reconfigure it for portrait mode.

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