コード例 #1
0
ファイル: Form1.cs プロジェクト: Simansons/PacManLv
        private void SetupGame()
        {
            Klucis.BackColor = Color.Transparent;
            Klucis.SizeMode  = PictureBoxSizeMode.StretchImage;
            Klucis.Width     = 50;
            Klucis.Height    = 50;
            Food.BackColor   = Color.Green;
            Food.BackColor   = Color.Transparent;
            Food.Image       = Properties.Resources.food_3;
            Food.SizeMode    = PictureBoxSizeMode.StretchImage;
            Enemy.BackColor  = Color.Transparent;
            Enemy.SizeMode   = PictureBoxSizeMode.StretchImage;
            Enemy.Width      = 40;
            Enemy.Height     = 40;
            this.BackColor   = Color.Blue;

            SetRandomEnemyDirection();

            UpdateScoreLabel();

            //initializing timers
            TimerKlucisMove.Start();
            TimerKlucisAnimate.Start();
            TimerEnemyAnimate.Start();
            TimerEnemyMove.Start();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Simansons/PacManLv
 private void GameOver()
 {
     TimerKlucisMove.Stop();
     TimerKlucisAnimate.Stop();
     TimerEnemyAnimate.Stop();
     TimerEnemyMove.Stop();
     Enemy.Visible = false;
     Food.Visible  = false;
     klucisImage   = 0;
     TimerKlucisMelt.Start();
 }