Ejemplo n.º 1
0
        /// <summary>
        /// Create and spawn the projectile(s) from a firing from this weapon.
        /// </summary>
        /// <param name="direction">The direction that the projectile will move.</param>
        protected override void CreateProjectiles(Vector2 direction)
        {
            // calculate the direction vectors for the second and third projectiles
            float rotation = (float)Math.Acos(Vector2.Dot(new Vector2(0f, -1f),
                                                          direction));

            rotation *= (Vector2.Dot(new Vector2(0f, -1f),
                                     new Vector2(direction.Y, -direction.X)) > 0f) ? 1f : -1f;
            Vector2 direction2 = new Vector2(
                (float)Math.Sin(rotation - laserSpreadRadians),
                -(float)Math.Cos(rotation - laserSpreadRadians));
            Vector2 direction3 = new Vector2(
                (float)Math.Sin(rotation + laserSpreadRadians),
                -(float)Math.Cos(rotation + laserSpreadRadians));

            // create the first projectile
            HydrogenBoostProjectile projectile = new HydrogenBoostProjectile(owner.World, owner,
                                                                             direction);

            // spawn the projectile
            projectile.Spawn(false);

            // create the second projectile
            projectile = new HydrogenBoostProjectile(owner.World, owner,
                                                     direction2);
            // spawn the projectile
            projectile.Spawn(false);

            // create the third projectile
            projectile = new HydrogenBoostProjectile(owner.World, owner,
                                                     direction3);
            // spawn the projectile
            projectile.Spawn(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create and spawn the projectile(s) from a firing from this weapon.
        /// </summary>
        /// <param name="direction">The direction that the projectile will move.</param>
        protected override void CreateProjectiles(Vector2 direction)
        {
            // create the new projectile
            HydrogenBoostProjectile projectile = new HydrogenBoostProjectile(owner.World, owner,
                                                                             direction);

            // spawn the projectile
            projectile.Spawn(false);
        }