Exemple #1
0
        void GameTick(object sender, EventArgs e)
        {
            if (MaxLevel > myBoard.LVL)
            {
                LevelProgressBar.Value = myBoard.GetLvlProc();
            }
            Score.Content = "Score: " + (myBoard.Score).ToString();
            Lines.Content = "Lines: " + myBoard.Lines.ToString();
            myBoard.CurTetraminoMovDown();

            if (myBoard.GameOver)
            {
                GameOver();
            }
            if (myBoard.LvlUp && MaxLevel > myBoard.LVL)
            {
                Timer.Interval  = new TimeSpan(0, 0, 0, 0, GameSpeed - SpeedStep * (myBoard.LVL - 1));
                myBoard.LvlUp   = false;
                LvlText.Content = "Level: " + myBoard.LVL;
                if (MaxLevel == myBoard.LVL)
                {
                    myBoard.StepLvl        = int.MaxValue;
                    LevelProgressBar.Value = LevelProgressBar.Maximum;
                }
            }
        }