Esempio n. 1
0
        public static void Load()
        {
            var random = new Random();

            _asteroids = new Asteroid[15];
            for (int i = 0; i < _asteroids.Length; i++)
            {
                var size = random.Next(10, 50);
                _asteroids[i] = new Asteroid(new Point(600, i * 20 + 10), new Point(-i - 1, -i - 1), new Size(size, size));
            }

            _farStars = new FarStar[50];
            for (int i = 0; i < _farStars.Length; i++)
            {
                _farStars[i] = new FarStar();
            }
        }
Esempio n. 2
0
 public static void Load()
 {
     r         = new Random();
     objs      = new BaseObject[320];
     asteroids = new List <Asteroid>();
     shards    = new List <Shard>();
     bullets   = new List <Bullet>();
     rockets   = new List <Rocket>();
     for (int i = 0; i < objs.Length / 2 + 40; i++)
     {
         objs[i] = new FarStar(new Point(r.Next(0, 1921), r.Next(0, 1081)), new Point(r.Next(-2, 0), 0), new Size(2, 2));
     }
     for (int i = objs.Length / 2 + 40; i < objs.Length; i++)
     {
         objs[i] = new Star(new Point(r.Next(0, 1921), r.Next(0, 1081)), new Point(r.Next(-4, -1), 0), new Size(5, 5));
     }
     for (int i = 0; i < countasteroids; i++)
     {
         asteroids.Add(new Asteroid(new Point(r.Next(300, 1921), r.Next(0, 1061)), new Point(r.Next(-10, -1), 15), new Size(1, 1)));
         asteroids[i].Size(new Size(asteroids[i].Power, asteroids[i].Power));
     }
 }