예제 #1
0
파일: Game.cs 프로젝트: Cheefs/Asteroids
        /// <summary>
        /// Генерация игровых обьектов
        /// </summary>
        public static void Load()
        {
            _objs = new BaseObject[100];
            _heal = new HelpElements(new Point(900, 200), new Point(5, 0), new Size(30, 30));

            int r = rnd.Next(10, 50);

            for (var i = 0; i < _objs.Length; i++)
            {
                r        = rnd.Next(5, 50);
                _objs[i] = new Star(new Point(Width, rnd.Next(0, 800)), new Point(-r, r), new Size(10, 10));

                string str = "Star";
                delLog.Do(str);
                Del += delLog.Do;
            }
            _planets = new Planets(new Point(Game.Width, 50), new Point(5, 0), new Size(300, 300));
        }
예제 #2
0
파일: Game.cs 프로젝트: Cheefs/Asteroids
        /// <summary>
        /// Метод востановления энергии
        /// </summary>
        static void BeHealed()
        {
            int tmpValue = rnd.Next(5, 20);

            if (_ship?.Energy < 100)
            {
                if (_ship?.Energy + tmpValue > 100)
                {
                    float tempValue = 0;
                    tempValue = 100 - _ship.Energy;
                    _ship.EnergyUp(tempValue);
                    str = Convert.ToInt32(tempValue).ToString();
                }
                else
                {
                    _ship?.EnergyUp(tmpValue);
                    str = tmpValue.ToString();
                }
                delLog.Healing(str);
                Del += delLog.Healing;
            }
            _heal.Geneerate();
            SystemSounds.Exclamation.Play();
        }
예제 #3
0
파일: Log.cs 프로젝트: Cheefs/Asteroids
 public void Remove(LogDeligate f)
 {
     myFunc -= f;
 }
예제 #4
0
파일: Log.cs 프로젝트: Cheefs/Asteroids
 public void Add(LogDeligate f)
 {
     myFunc += f;
 }