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.

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Sun Jul 28 03:35:36 2019 +0000
Parent:
8:6e28bd30cfb4
Child:
10:a09d9bb9c5c8
Commit message:
Update RA lib

Changed in this revision

RA8875.lib Show annotated file Show diff for this revision Revisions of this file
Tetris/Define.h Show annotated file Show diff for this revision Revisions of this file
Tetris/playGround.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/RA8875.lib	Mon Mar 04 12:16:19 2019 +0000
+++ b/RA8875.lib	Sun Jul 28 03:35:36 2019 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/WiredHome/code/RA8875/#f92c0f1f6db4
+http://mbed.org/users/WiredHome/code/RA8875/#c7fb7a4fb42f
--- a/Tetris/Define.h	Mon Mar 04 12:16:19 2019 +0000
+++ b/Tetris/Define.h	Sun Jul 28 03:35:36 2019 +0000
@@ -2,10 +2,10 @@
 //  GAME AND DESIGN PARAMETERS
 
 // Define this for 800x480 panel, undefine for 480x272
-//#define BIG_SCREEN
+#define BIG_SCREEN
 
 // Define this for Cap touch panel, undefine for resistive
-//#define CAP_TOUCH
+#define CAP_TOUCH
 
 #ifdef BIG_SCREEN
     #define LCD_W 800
--- a/Tetris/playGround.cpp	Mon Mar 04 12:16:19 2019 +0000
+++ b/Tetris/playGround.cpp	Sun Jul 28 03:35:36 2019 +0000
@@ -15,14 +15,14 @@
 #endif
 
 // Hot-Spots
-static const rect_t Drop   = { DROP };
-static const rect_t rLeft  = { ROT_LEFT };
-static const rect_t rRight = { ROT_RIGHT };
-static const rect_t mLeft  = { MOV_LEFT };
-static const rect_t mRight = { MOV_RIGHT };
-static const rect_t Replay = { REPLAY };
-static const point_t orig  = {ORIGIN_X,ORIGIN_Y};
-static const point_t sb_orig = {SB_X, SB_Y};
+static const rect_t Drop   = rect_t( DROP );
+static const rect_t rLeft  = rect_t( ROT_LEFT );
+static const rect_t rRight = rect_t( ROT_RIGHT );
+static const rect_t mLeft  = rect_t( MOV_LEFT );
+static const rect_t mRight = rect_t( MOV_RIGHT );
+static const rect_t Replay = rect_t( REPLAY );
+static const point_t orig  = point_t(ORIGIN_X,ORIGIN_Y);
+static const point_t sb_orig = point_t(SB_X, SB_Y);
 // Convert cell coordinates to a rectangle location
 //
 rect_t CellPosToRect(int x, int y, point_t o = orig, int bs = BLOCK_SIZE) {