Esempio n. 1
0
        private void SetupGame()
        {
            this.BackColor = Color.SkyBlue;

            Hero.BackColor = Color.Transparent;
            Hero.SizeMode  = PictureBoxSizeMode.StretchImage;
            Hero.Width     = 30;
            Hero.Height    = 30;

            UpdateScore();
            Food.BackColor = Color.Transparent;
            Food.SizeMode  = PictureBoxSizeMode.StretchImage;
            Food.Image     = Properties.Resources.food_1;
            Food.Width     = 18;
            Food.Height    = 18;

            Enemy.BackColor = Color.Transparent;
            Enemy.Width     = 30;
            Enemy.Height    = 30;
            Enemy.SizeMode  = PictureBoxSizeMode.StretchImage;

            TimerHeroAnimate.Start();
            TimerHeroMove.Start();
            TimerEnemyAnimate.Start();
            TimerEnemyMove.Start();
        }
Esempio n. 2
0
        private void SetupGame()
        {
            this.BackColor = Color.Blue;
            Hero.BackColor = Color.Transparent;
            Hero.SizeMode  = PictureBoxSizeMode.StretchImage;
            Hero.Width     = 50;
            Hero.Height    = 50;

            Food.BackColor = Color.Green;
            Food.BackColor = Color.Transparent;
            Food.Image     = Properties.Resources.food_4;

            Enemy.BackColor = Color.Transparent;
            Enemy.Width     = 40;
            Enemy.Height    = 40;
            Enemy.SizeMode  = PictureBoxSizeMode.StretchImage;

            SetRandomEnemyDirection();

            //initialize interface
            UpdateScoreLabel();

            //initializing timers
            TimerHeroMove.Start();
            TimerHeroAnimate.Start();
            TimerEnemyAnimate.Start();
            TimerEnemyMove.Start();
        }