Ejemplo n.º 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);
                 linesCompletedThisLevel++;
                 floodCount = MathHelper.Clamp(floodCount - (DetermineScore(WaterChain.Count) / 10), 0.0f, 100.0f);
                 ScoreZooms.Enqueue(new ScoreZoom("+" + DetermineScore(WaterChain.Count).ToString(), new Color(1.0f, 0.0f, 0.0f, 0.4f)));
                 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 (linesCompletedThisLevel >= 10)
                 {
                     StartNewLevel();
                 }
             }
         }
     }
 }
Ejemplo n.º 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.SetSquare((int)ScoringSquare.X,
                                                (int)ScoringSquare.Y, "Empty");
                        }
                    }
                }
            }
        }