Esempio n. 1
0
        public void changeColorLabel()
        {
            Color c = GameBackground.NextColor();

            label1.ForeColor   = c;
            label5.ForeColor   = c;
            lblLevel.ForeColor = c;
            lblPause.ForeColor = c;
            lblScore.ForeColor = c;
        }
Esempio n. 2
0
        public void AddEnemy()
        {
            if (CharPool.Count == 0)
            {
                gameLevel.levelUp();
                TheForm.TimerCreateLetter.Interval = gameLevel.ENEMY_APPEAR;
                TheForm.TimerMoveEnemies.Interval  = gameLevel.ENEMY_SPEED;
                generatePool();
                if (gameLevel.LEVEL % 3 == 0)
                {
                    TheForm.BackgroundImage = GameBackground.NextImage();
                    TheForm.changeColorLabel();
                }
            }
            int  i        = Random.Next(0, CharPool.Count);
            Char selected = CharPool[i];

            CharPool.RemoveAt(i);
            Enemy enemy        = enemy = new Enemy(TheForm, findValidSpawn(), selected);
            bool  thereIsPower = false;

            foreach (Enemy e in Enemies)
            {
                if (e.Name == "SlowMotion" || e.Name == "Bonus" || e.Name == "Destroyer")
                {
                    thereIsPower = true;
                }
            }

            if (!thereIsPower && !isSlowMotionActive && gameLevel.LEVEL > 1)
            {
                int rnd = Random.Next(0, 30);
                if (rnd == 7 && gameLevel.LEVEL > 3)
                {
                    enemy = new PowerUp_SlowMotion(TheForm, findValidSpawn(), selected);
                }
                else if (rnd > 26)
                {
                    enemy = new PowerUp_Bonus(TheForm, findValidSpawn(), selected);
                }
                else if (rnd == 13 && gameLevel.LEVEL > 4)
                {
                    enemy = new PowerUp_Destroyer(TheForm, findValidSpawn(), selected);
                }
            }
            Enemies.Add(enemy);
        }
Esempio n. 3
0
        public void newGame()
        {
            GameBackground.Initialize();
            this.BackgroundImage = GameBackground.NextImage();
            changeColorLabel();
            this.KeyPreview = true;
            TheGame         = new Game(this);
            InitializeTimers();
            CurrentScore = 0;

            Image i = Properties.Resources.rsz_exit;

            pbExit.Image     = i;
            pbExit.Width     = i.Width;
            pbExit.Height    = i.Height;
            pbExit.BackColor = Color.Transparent;

            SetSoundImage();
            SetPauseImage();

            lblPause.Visible = IsPaused = false;
        }