Beispiel #1
0
 // Clear score update notification every 2 seconds
 private void ScoreUpdateTimer_Tick(object sender, EventArgs e)
 {
     ScoreUpdateLabel.Text = "";
     ScoreUpdateTimer.Stop();
 }
Beispiel #2
0
        private void UpdateScore()
        {
            // 1-3 line clear is worth 100 per line
            // Quad line clear (no combo) is worth 800
            // 2 or more quad line clears in a row is worth 1200

            bool skipComboReset = false;

            // Single clear
            if (combo == 0)
            {
                score += 100;
                ScoreUpdateLabel.Text = "+100";
            }

            // Double clear
            else if (combo == 1)
            {
                score += 100;
                ScoreUpdateLabel.Text = "+200";
            }

            // Triple clear
            else if (combo == 2)
            {
                score += 100;
                ScoreUpdateLabel.Text = "+300";
            }

            // Quad clear, start combo
            else if (combo == 3)
            {
                score += 500;
                ScoreUpdateLabel.Text = "+800";
                skipComboReset        = true;
            }

            // Single clear, broken combo
            else if (combo > 3 && combo % 4 == 0)
            {
                score += 100;
                ScoreUpdateLabel.Text = "+100";
            }

            // Double clear, broken combo
            else if (combo > 3 && ((combo - 1) % 4 == 0))
            {
                score += 100;
                ScoreUpdateLabel.Text = "+200";
            }

            // Triple clear, broken combo
            else if (combo > 3 && ((combo - 2) % 4 == 0))
            {
                score += 100;
                ScoreUpdateLabel.Text = "+300";
            }

            // Quad clear, continue combo
            else if (combo > 3 && ((combo - 3) % 4 == 0))
            {
                score += 900;
                ScoreUpdateLabel.Text = "+1200";
                skipComboReset        = true;
            }

            if (CheckForCompleteRows() == -1 && skipComboReset == false)
            {
                // 1-3 line clear
                combo = 0;
            }
            else
            {
                // Quad clear
                combo++;
            }

            ScoreLabel.Text = "Score: " + score.ToString();
            ScoreUpdateTimer.Start();
        }