Sound update

Dependencies:   4DGL-uLCD-SE Physac-MBED PinDetect SDFileSystem mbed-rtos mbed

Committer:
jaybalar
Date:
Fri Dec 09 21:28:32 2022 +0000
Revision:
31:b08cc3c126d6
Parent:
26:163d7ca8c42d
update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jsanchez307 15:e9f3b72b7486 1 #ifndef _BOARD_
jsanchez307 15:e9f3b72b7486 2 #define _BOARD_
jsanchez307 15:e9f3b72b7486 3
jsanchez307 15:e9f3b72b7486 4 // ------ Includes -----
jsanchez307 15:e9f3b72b7486 5
jsanchez307 15:e9f3b72b7486 6 #include "Pieces.h"
jsanchez307 15:e9f3b72b7486 7
jsanchez307 15:e9f3b72b7486 8 // ------ Defines -----
jsanchez307 15:e9f3b72b7486 9
jsanchez307 15:e9f3b72b7486 10 #define BOARD_LINE_WIDTH 6 // Width of each of the two lines that delimit the board
jsanchez307 15:e9f3b72b7486 11 #define BLOCK_SIZE 6 // Width and Height of each block of a piece
jsanchez307 15:e9f3b72b7486 12 #define BOARD_POSITION 50 // Center position of the board from the left of the screen
jsanchez307 15:e9f3b72b7486 13 #define BOARD_WIDTH 10 // Board width in blocks
jsanchez307 15:e9f3b72b7486 14 #define BOARD_HEIGHT 20 // Board height in blocks
jsanchez307 15:e9f3b72b7486 15 #define MIN_VERTICAL_MARGIN 8 // Minimum vertical margin for the board limit
jsanchez307 15:e9f3b72b7486 16 #define MIN_HORIZONTAL_MARGIN 20 // Minimum horizontal margin for the board limit
jsanchez307 15:e9f3b72b7486 17 #define PIECE_BLOCKS 5 // Number of horizontal and vertical blocks of a matrix piece
jsanchez307 15:e9f3b72b7486 18
jsanchez307 15:e9f3b72b7486 19
jsanchez307 15:e9f3b72b7486 20 // --------------------------------------------------------------------------------
jsanchez307 15:e9f3b72b7486 21 // Board
jsanchez307 15:e9f3b72b7486 22 // --------------------------------------------------------------------------------
jsanchez307 15:e9f3b72b7486 23
jsanchez307 15:e9f3b72b7486 24 class Board
jsanchez307 15:e9f3b72b7486 25 {
jsanchez307 15:e9f3b72b7486 26 public:
jsanchez307 15:e9f3b72b7486 27
jsanchez307 15:e9f3b72b7486 28 Board (Pieces *pPieces, int pScreenHeight);
jsanchez307 15:e9f3b72b7486 29
jsanchez307 15:e9f3b72b7486 30 int GetXPosInPixels (int pPos);
jsanchez307 15:e9f3b72b7486 31 int GetYPosInPixels (int pPos);
jsanchez307 15:e9f3b72b7486 32 bool IsFreeBlock (int pX, int pY);
jsanchez307 15:e9f3b72b7486 33 bool IsPossibleMovement (int pX, int pY, int pPiece, int pRotation);
jsanchez307 15:e9f3b72b7486 34 void StorePiece (int pX, int pY, int pPiece, int pRotation);
jsanchez307 15:e9f3b72b7486 35 int DeletePossibleLines ();
jsanchez307 15:e9f3b72b7486 36 bool IsGameOver ();
jsanchez307 26:163d7ca8c42d 37 void InitBoard();
jsanchez307 15:e9f3b72b7486 38
jsanchez307 15:e9f3b72b7486 39 private:
jsanchez307 15:e9f3b72b7486 40
jsanchez307 15:e9f3b72b7486 41 // enum holds no value besides the described properties
jsanchez307 15:e9f3b72b7486 42 enum { POS_FREE, POS_FILLED }; // POS_FREE = free position of the board; POS_FILLED = filled position of the board
jsanchez307 15:e9f3b72b7486 43 int mBoard [BOARD_WIDTH][BOARD_HEIGHT]; // Board that contains the pieces
jsanchez307 15:e9f3b72b7486 44 Pieces *mPieces;
jsanchez307 15:e9f3b72b7486 45 int mScreenHeight;
jsanchez307 15:e9f3b72b7486 46
jsanchez307 26:163d7ca8c42d 47 //void InitBoard();
jsanchez307 15:e9f3b72b7486 48 void DeleteLine (int pY);
jsanchez307 15:e9f3b72b7486 49 };
jsanchez307 15:e9f3b72b7486 50
jsanchez307 15:e9f3b72b7486 51 #endif