Пример #1
0
 private void CheckScoringChain(List <Vector2> WaterChain)
 {
     if (WaterChain.Count > 0)
     {
         Vector2 LastPipe = WaterChain[WaterChain.Count - 1];
         if (LastPipe.X == GameBoard.GameBoardWidth - 1)
         {
             if (gameBoard.HasConnector(
                     (int)LastPipe.X, (int)LastPipe.Y, "Right"))
             {
                 playerScore += DetermineScore(WaterChain.Count);
                 linesCompetedThisLevel++;
                 ScoreZooms.Enqueue(new ScoreZoom("+" +
                                                  DetermineScore(WaterChain.Count).ToString(),
                                                  new Color(1.0f, 0.0f, 0.0f, 0.4f)));
                 floodCount = MathHelper.Clamp(floodCount -
                                               (DetermineScore(WaterChain.Count) / 30), 0.0f, 100.0f);
                 foreach (Vector2 ScoringSquare in WaterChain)
                 {
                     gameBoard.AddFadingPiece((int)ScoringSquare.X, (int)ScoringSquare.Y,
                                              gameBoard.GetSquare((int)ScoringSquare.X, (int)ScoringSquare.Y));
                     gameBoard.SetSquare((int)ScoringSquare.X,
                                         (int)ScoringSquare.Y, "Empty");
                 }
                 if (linesCompetedThisLevel >= 5)
                 {
                     StartNewLevel();
                 }
             }
         }
     }
 }
Пример #2
0
        private void CheckScoringChain(List <Vector2> WaterChain)
        {
            if (WaterChain.Count > 0)
            {
                Vector2 LastPipe = WaterChain[WaterChain.Count - 1];

                if (LastPipe.X == GameBoard.GameBoardWidth - 1)
                {
                    if (gameBoard.HasConnector((int)LastPipe.X, (int)LastPipe.Y, "Right"))
                    {
                        playerScore += DetermineScore(WaterChain.Count);

                        foreach (Vector2 ScoringSquare in WaterChain)
                        {
                            gameBoard.AddFadingPiece((int)ScoringSquare.X, (int)ScoringSquare.Y, gameBoard.GetSquare((int)ScoringSquare.X, (int)ScoringSquare.Y));
                            gameBoard.SetSquare((int)ScoringSquare.X, (int)ScoringSquare.Y, "Empty");
                        }
                    }
                }
            }
        }