Exemplo n.º 1
0
        public Asteroid CreateAsteroid()
        {
            Asteroid asteroid = new Asteroid(size, speed);

            asteroid.InitializeSprite();
            asteroid.SetLocation(RandomizeX(), -100);
            asteroid.SetSpriteLocation();
            return(asteroid);
        }
Exemplo n.º 2
0
        public Asteroid CreateAsteroid()
        {
            if (randomNum >= 3 || String.IsNullOrEmpty(randomNum.ToString()))
            {
                randomNum = 0;
            }

            //randomize types of asteroids
            int      astPos   = randNum[randomNum];
            Asteroid asteroid = new Asteroid(new Size(astPos, astPos), speed);

            asteroid.InitializeSprite();
            asteroid.SetLocation(RandomizeX(), -100);
            asteroid.PositionSprite();
            randomNum++;
            return(asteroid);
        }