Sound update
Dependencies: 4DGL-uLCD-SE Physac-MBED PinDetect SDFileSystem mbed-rtos mbed
tetris/Game.h@19:6d9bee043ede, 22 months ago (annotated)
- Committer:
- jstephens78
- Date:
- Sun Dec 04 23:31:28 2022 +0000
- Revision:
- 19:6d9bee043ede
- Parent:
- Tetris/Game.h@15:e9f3b72b7486
- Child:
- 26:163d7ca8c42d
Tetris compiles now
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jsanchez307 | 15:e9f3b72b7486 | 1 | #ifndef _GAME_ |
jsanchez307 | 15:e9f3b72b7486 | 2 | #define _GAME_ |
jsanchez307 | 15:e9f3b72b7486 | 3 | |
jsanchez307 | 15:e9f3b72b7486 | 4 | // ------ Includes ----- |
jsanchez307 | 15:e9f3b72b7486 | 5 | |
jsanchez307 | 15:e9f3b72b7486 | 6 | #include "Board.h" |
jsanchez307 | 15:e9f3b72b7486 | 7 | #include "Pieces.h" |
jsanchez307 | 15:e9f3b72b7486 | 8 | #include "uLCD_4DGL.h" |
jsanchez307 | 15:e9f3b72b7486 | 9 | |
jsanchez307 | 15:e9f3b72b7486 | 10 | // ------ Defines ----- |
jsanchez307 | 15:e9f3b72b7486 | 11 | |
jsanchez307 | 15:e9f3b72b7486 | 12 | #define WAIT_TIME 700 // Number of milliseconds that the piece remains before going 1 block down */ |
jsanchez307 | 15:e9f3b72b7486 | 13 | |
jsanchez307 | 15:e9f3b72b7486 | 14 | |
jsanchez307 | 15:e9f3b72b7486 | 15 | // ----------------------------------------------------- |
jsanchez307 | 15:e9f3b72b7486 | 16 | // Game |
jsanchez307 | 15:e9f3b72b7486 | 17 | // ----------------------------------------------------- |
jsanchez307 | 15:e9f3b72b7486 | 18 | |
jsanchez307 | 15:e9f3b72b7486 | 19 | class Game |
jsanchez307 | 15:e9f3b72b7486 | 20 | { |
jsanchez307 | 15:e9f3b72b7486 | 21 | public: |
jsanchez307 | 15:e9f3b72b7486 | 22 | |
jsanchez307 | 15:e9f3b72b7486 | 23 | Game (Board *pBoard, Pieces *pPieces, int pScreenHeight, uLCD_4DGL *uLCD,int,int,int,int); |
jsanchez307 | 15:e9f3b72b7486 | 24 | |
jsanchez307 | 15:e9f3b72b7486 | 25 | void DrawScene (); |
jsanchez307 | 15:e9f3b72b7486 | 26 | void CreateNewPiece (int,int); |
jsanchez307 | 15:e9f3b72b7486 | 27 | |
jsanchez307 | 15:e9f3b72b7486 | 28 | void ErasePiece(int x,int y,int piece, int rotation); |
jsanchez307 | 15:e9f3b72b7486 | 29 | void DrawBoard (); |
jsanchez307 | 15:e9f3b72b7486 | 30 | void AddPoints(int); |
jsanchez307 | 15:e9f3b72b7486 | 31 | void AddClearedLines(int); |
jsanchez307 | 15:e9f3b72b7486 | 32 | int GetPoints(); |
jsanchez307 | 15:e9f3b72b7486 | 33 | int GetClearedLines(); |
jsanchez307 | 15:e9f3b72b7486 | 34 | |
jsanchez307 | 15:e9f3b72b7486 | 35 | int mPosX, mPosY; // Position of the piece that is falling down |
jsanchez307 | 15:e9f3b72b7486 | 36 | int mPiece, mRotation; // Kind and rotation the piece that is falling down |
jsanchez307 | 15:e9f3b72b7486 | 37 | |
jsanchez307 | 15:e9f3b72b7486 | 38 | int points; |
jsanchez307 | 15:e9f3b72b7486 | 39 | int clearedLineCount; |
jsanchez307 | 15:e9f3b72b7486 | 40 | |
jsanchez307 | 15:e9f3b72b7486 | 41 | |
jsanchez307 | 15:e9f3b72b7486 | 42 | private: |
jsanchez307 | 15:e9f3b72b7486 | 43 | |
jsanchez307 | 15:e9f3b72b7486 | 44 | int mScreenHeight; // Screen height in pixels |
jsanchez307 | 15:e9f3b72b7486 | 45 | int mNextPosX, mNextPosY; // Position of the next piece |
jsanchez307 | 15:e9f3b72b7486 | 46 | int mNextPiece, mNextRotation; // Kind and rotation of the next piece |
jsanchez307 | 15:e9f3b72b7486 | 47 | |
jsanchez307 | 15:e9f3b72b7486 | 48 | Board *mBoard; |
jsanchez307 | 15:e9f3b72b7486 | 49 | Pieces *mPieces; |
jsanchez307 | 15:e9f3b72b7486 | 50 | uLCD_4DGL *uLCD; |
jsanchez307 | 15:e9f3b72b7486 | 51 | |
jsanchez307 | 15:e9f3b72b7486 | 52 | |
jsanchez307 | 15:e9f3b72b7486 | 53 | void InitGame(int,int,int,int); |
jsanchez307 | 15:e9f3b72b7486 | 54 | void DrawPiece (int pX, int pY, int pPiece, int pRotation, int colorIndex); |
jsanchez307 | 15:e9f3b72b7486 | 55 | |
jsanchez307 | 15:e9f3b72b7486 | 56 | }; |
jsanchez307 | 15:e9f3b72b7486 | 57 | |
jsanchez307 | 15:e9f3b72b7486 | 58 | #endif // _GAME_ |