예제 #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
파일: Form1.cs 프로젝트: dawid1103/Invaders
        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
파일: Form1.cs 프로젝트: dahopkin/Invaders
        } // 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