Jay Balar / Mbed 2 deprecated 4180_Project_3

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

Revision:
19:6d9bee043ede
Parent:
18:cf74968078ea
Child:
20:73e4f12277bd
diff -r cf74968078ea -r 6d9bee043ede Tetris/Pieces.cpp
--- a/Tetris/Pieces.cpp	Thu Dec 01 01:46:22 2022 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,328 +0,0 @@
-#include "Pieces.h"
-
-// Define the Pieces
-char mPieces [7 /*kind */ ][4 /* rotation */ ][5 /* horizontal blocks */ ][5 /* vertical blocks */ ] =
-{
-// Square
-  {
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 2, 1, 0},
-    {0, 0, 1, 1, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 2, 1, 0},
-    {0, 0, 1, 1, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 2, 1, 0},
-    {0, 0, 1, 1, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 2, 1, 0},
-    {0, 0, 1, 1, 0},
-    {0, 0, 0, 0, 0}
-    }
-   },
-
-// I
-  {
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 1, 2, 1, 1},
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 1, 0, 0}, 
-    {0, 0, 2, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 1, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {1, 1, 2, 1, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 1, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 2, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 0, 0, 0}
-    }
-   }
-  ,
-// L
-  {
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 2, 0, 0},
-    {0, 0, 1, 1, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 1, 2, 1, 0},
-    {0, 1, 0, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 1, 1, 0, 0},
-    {0, 0, 2, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 1, 0},
-    {0, 1, 2, 1, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0}
-    }
-   },
-// L mirrored
-  {
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 2, 0, 0},
-    {0, 1, 1, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 1, 0, 0, 0},
-    {0, 1, 2, 1, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 1, 1, 0},
-    {0, 0, 2, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 1, 2, 1, 0},
-    {0, 0, 0, 1, 0},
-    {0, 0, 0, 0, 0}
-    }
-   },
-// N
-  {
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 1, 0},
-    {0, 0, 2, 1, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 1, 2, 0, 0},
-    {0, 0, 1, 1, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 1, 2, 0, 0},
-    {0, 1, 0, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 1, 1, 0, 0},
-    {0, 0, 2, 1, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0}
-    }
-   },
-// N mirrored
-  {
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 2, 1, 0},
-    {0, 0, 0, 1, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 2, 1, 0},
-    {0, 1, 1, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 1, 0, 0, 0},
-    {0, 1, 2, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 1, 1, 0},
-    {0, 1, 2, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0}
-    }
-   },
-// T
-  {
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 2, 1, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0},
-    {0, 1, 2, 1, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 1, 2, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 0, 0, 0, 0}
-    },
-   {
-    {0, 0, 0, 0, 0},
-    {0, 0, 1, 0, 0},
-    {0, 1, 2, 1, 0},
-    {0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0}
-    }
-   }
-};
-
-// Displacement of the piece to the position where it is first drawn in the board when it is created
-int mPiecesInitialPosition  [7 /*kind */ ][4 /* rotation */ ][2 /* position */] =
-{
-/* Square */
-  {
-    {-2, -3}, 
-    {-2, -3},
-    {-2, -3},
-    {-2, -3}
-   },
-/* I */
-  {
-    {-2, -2},
-    {-2, -3},
-    {-2, -2},
-    {-2, -3}
-   },
-/* L */
-  {
-    {-2, -3},
-    {-2, -3},
-    {-2, -3},
-    {-2, -2}
-   },
-/* L mirrored */
-  {
-    {-2, -3},
-    {-2, -2},
-    {-2, -3},
-    {-2, -3}
-   },
-/* N */
-  {
-    {-2, -3},
-    {-2, -3},
-    {-2, -3},
-    {-2, -2}
-   },
-/* N mirrored */
-  {
-    {-2, -3},
-    {-2, -3},
-    {-2, -3},
-    {-2, -2}
-   },
-/* T */
-  {
-    {-2, -3},
-    {-2, -3},
-    {-2, -3},
-    {-2, -2}
-   },
-};
-
-/* 
-======================================                                  
-Return the type of a block (0 = no-block, 1 = normal block, 2 = pivot block)
-
-Parameters:
-
-int pPiece:      Piece to draw
-int pRotation:   1 of the 4 possible rotations
-int pX:          Horizontal position in blocks
-int pY:          Vertical position in blocks
-====================================== 
-*/
-int Pieces::GetBlockType (int pPiece, int pRotation, int pX, int pY)
-{
-    return mPieces [pPiece][pRotation][pX][pY];
-}
-
-/* 
-======================================                                  
-Returns the horizontal displacement of the piece that has to be applied in order to create it in the
-correct position.
-
-Parameters:
-
-int pPiece:  Piece to draw
-int pRotation:   1 of the 4 possible rotations
-====================================== 
-*/
-int Pieces::GetXInitialPosition (int pPiece, int pRotation)
-{
-    return mPiecesInitialPosition [pPiece][pRotation][0];
-}
-
-/* 
-======================================                                  
-Returns the vertical displacement of the piece that has to be applied in order to create it in the
-correct position.
-
-Parameters:
-
-int pPiece:  Piece to draw
-int pRotation:   1 of the 4 possible rotations
-====================================== 
-*/
-int Pieces::GetYInitialPosition (int pPiece, int pRotation)
-{
-    return mPiecesInitialPosition [pPiece][pRotation][1];
-}