Esempio n. 1
0
 //Checks for legal collisions that will cause block placement next timer tick
 //If legal collision is imenent applies the action and sets about to place flag
 private static void checkAboutToPlace(List <Block> blocks, GameShape shape, List <Vector2> occupiedCoordinates)
 {
     foreach (Block b in blocks)
     {
         Vector2 blockCoord = b.GetPosition();
         //check for bottom row collision
         if (blockCoord.Y == 0)
         {
             shape.AboutToPlaceGameShape();
         }
         //above occupied coord collision check
         else
         {
             Vector2 temp;
             temp.X = blockCoord.X;
             temp.Y = blockCoord.Y - 1;
             if (occupiedCoordinates.Contains(temp))
             {
                 shape.AboutToPlaceGameShape();
             }
         }
     }
 }