Exemplo n.º 1
0
        /// <summary>
        /// Creates a new star with the provided properties, and adds it to the world.
        /// </summary>
        /// <param name="starX">x coordinate of this stars location</param>
        /// <param name="starY">y coordinate of this stars location</param>
        /// <param name="starMass">mass of this star</param>
        public void SpawnStars(double starX, double starY, double starMass)
        {
            Vector2D starLocation = new Vector2D(starX, starY);

            Star newStar = new Star(starIDs++, starLocation, starMass);

            newStar.SetHP(BossHealth);

            this.addStar(newStar);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Spawns a star using the properties of an existing star. Used for respawning existing stars which have been killed (boss mode only.) Spawn location is retained from initial star.
        /// </summary>
        /// <param name="star">star to be respawned</param>
        public void respawnStar(Star star)
        {
            Vector2D newLoc  = new Vector2D(star.GetLocation());
            Star     newStar = new Star(star.GetID(), newLoc, star.GetMass());

            // Set ship's modifiable variables
            newStar.SetHP(BossHealth);

            this.addStar(newStar);
        }