Пример #1
0
 private void animationTimer_Tick(object sender, EventArgs e)
 {
     if (Frame < 3)
     {
         Frame++;
     }
     else
     {
         Frame = 0;
     }
     game.Twinkle();
     Refresh();
 }
Пример #2
0
        private void animationTimer_Tick(object sender, EventArgs e)
        {
            game?.Twinkle();
            frame++;
            if (frame >= 6)
            {
                frame = 0;
            }
            switch (frame)
            {
            case 0:
                animationCell = 0;
                break;

            case 1:
                animationCell = 1;
                break;

            case 2:
                animationCell = 2;
                break;

            case 3:
                animationCell = 3;
                break;

            case 4:
                animationCell = 2;
                break;

            case 5:
                animationCell = 1;
                break;

            default:
                animationCell = 0;
                break;
            }
            Invalidate();
        }
Пример #3
0
        private void Animate()
        {
            frame++;
            if (frame >= 6)
            {
                frame = 0;
            }
            switch (frame)
            {
            case 0:
                cell = 0;
                break;

            case 1:
                cell = 1;
                break;

            case 2:
                cell = 2;
                break;

            case 3:
                cell = 3;
                break;

            case 4:
                cell = 2;
                break;

            case 5:
                cell = 1;
                break;

            default:
                cell = 0;
                break;
            }

            game.Twinkle();
        }
Пример #4
0
        } // end method game_GameOver

        private void animationTimer_Tick(object sender, EventArgs e)
        {
            if (animationCounter == 3)
            {
                reverseInvaderAnimation = true;
            }
            else if (animationCounter == 0)
            {
                reverseInvaderAnimation = false;
            }

            if (reverseInvaderAnimation)
            {
                animationCounter--;
            }
            else
            {
                animationCounter++;
            }

            game.Twinkle();

            Refresh();
        } // end method animationTimer_Tick