Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE Physac-MBED PinDetect SDFileSystem mbed-rtos mbed
Game.h
00001 #ifndef _GAME_ 00002 #define _GAME_ 00003 00004 // ------ Includes ----- 00005 00006 #include "Board.h" 00007 #include "Pieces.h" 00008 #include "uLCD_4DGL.h" 00009 00010 // ------ Defines ----- 00011 00012 #define WAIT_TIME 700 // Number of milliseconds that the piece remains before going 1 block down */ 00013 00014 00015 // ----------------------------------------------------- 00016 // Game 00017 // ----------------------------------------------------- 00018 00019 class Game 00020 { 00021 public: 00022 00023 Game (Board *pBoard, Pieces *pPieces, int pScreenHeight, uLCD_4DGL *uLCD,int,int,int,int); 00024 00025 void DrawScene (); 00026 void CreateNewPiece (int,int); 00027 00028 void ErasePiece(int x,int y,int piece, int rotation); 00029 void DrawBoard (); 00030 void AddPoints(int); 00031 void AddClearedLines(int); 00032 int GetPoints(); 00033 int GetClearedLines(); 00034 00035 int mPosX, mPosY; // Position of the piece that is falling down 00036 int mPiece, mRotation; // Kind and rotation the piece that is falling down 00037 00038 int points; 00039 int clearedLineCount; 00040 00041 void InitGame(int,int,int,int); 00042 00043 00044 private: 00045 00046 int mScreenHeight; // Screen height in pixels 00047 int mNextPosX, mNextPosY; // Position of the next piece 00048 int mNextPiece, mNextRotation; // Kind and rotation of the next piece 00049 00050 Board *mBoard; 00051 Pieces *mPieces; 00052 uLCD_4DGL *uLCD; 00053 00054 00055 //void InitGame(int,int,int,int); 00056 void DrawPiece (int pX, int pY, int pPiece, int pRotation, int colorIndex); 00057 00058 }; 00059 00060 #endif // _GAME_
Generated on Fri Dec 9 2022 21:28:44 by
1.7.2