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.

Committer:
WiredHome
Date:
Sun Mar 29 18:21:14 2020 +0000
Revision:
11:2bdc83648d7f
Parent:
7:0e426e81c566
Pick up a bug-fix on jpeg rendering

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WiredHome 7:0e426e81c566 1 #ifndef PLAYGROUND_H
WiredHome 7:0e426e81c566 2 #define PLAYGROUND_H
WiredHome 7:0e426e81c566 3
WiredHome 7:0e426e81c566 4
WiredHome 5:5ce8976cd303 5 #include "mbed.h"
WiredHome 5:5ce8976cd303 6 #include "RA8875.h"
WiredHome 5:5ce8976cd303 7 #include "Block.h"
WiredHome 5:5ce8976cd303 8 #include "Define.h"
WiredHome 6:d2aa47c92687 9 #include "Field.h"
WiredHome 5:5ce8976cd303 10
WiredHome 7:0e426e81c566 11 typedef enum {
WiredHome 7:0e426e81c566 12 drop = 0,
WiredHome 7:0e426e81c566 13 move_right = 1,
WiredHome 7:0e426e81c566 14 move_left = 2,
WiredHome 7:0e426e81c566 15 spin_cw = 3,
WiredHome 7:0e426e81c566 16 spin_ccw = 4,
WiredHome 7:0e426e81c566 17 ignore = 13
WiredHome 7:0e426e81c566 18 } gesture_t;
WiredHome 7:0e426e81c566 19
WiredHome 7:0e426e81c566 20 extern RA8875 TFT;
WiredHome 7:0e426e81c566 21 extern RawSerial pc;
WiredHome 7:0e426e81c566 22
WiredHome 5:5ce8976cd303 23 void TFTInit();
WiredHome 5:5ce8976cd303 24 void ReInitGame();
WiredHome 5:5ce8976cd303 25 bool ReplayTouched();
WiredHome 5:5ce8976cd303 26 void drawMap();
WiredHome 5:5ce8976cd303 27 void drawMapV2();
WiredHome 5:5ce8976cd303 28 void drawBlock(Block NewBlock);
WiredHome 5:5ce8976cd303 29 void drawFrame();
WiredHome 5:5ce8976cd303 30 void clrBlock(Block NewBlock);
WiredHome 7:0e426e81c566 31 gesture_t getGesture();
WiredHome 7:0e426e81c566 32 Block doGest(Block NewBlock, point_t p);
WiredHome 5:5ce8976cd303 33 void gameOver(int score);
WiredHome 5:5ce8976cd303 34 void drawScore(int score);
WiredHome 7:0e426e81c566 35 void drawPeriod(int period);
WiredHome 5:5ce8976cd303 36 void drawNextBlock(Block NewBlock);
WiredHome 7:0e426e81c566 37 void clrNextBlock(Block NewBlock);
WiredHome 7:0e426e81c566 38
WiredHome 7:0e426e81c566 39 #endif // PLAYGROUND_H