private void LoadFireballs()
        {
            //the direction the fireballs will travel
            Vector2 direction1;
            Vector2 direction2;
            Vector2 direction3;

            //all fireballs originate in the mouth
            Vector2 location;

            location.X  = this.center.X;
            location.X -= MovementConstants.AquamentusFireballChangeX;
            if (aquamentusSprite.StartingFrameIndex == (int)AquamentusSprite.FrameIndex.RightFacing)
            {
                location.X += 2 * MovementConstants.AquamentusFireballChangeX;
            }
            location.Y = this.center.Y - 10;

            direction2 = player.Center - location;
            direction2.Normalize();
            double angle2 = Math.Atan2(direction2.Y, direction2.X);
            double angle1 = angle2 + MovementConstants.AquamentusFireballSpreadAngle;
            double angle3 = angle2 - MovementConstants.AquamentusFireballSpreadAngle;

            direction1 = new Vector2((float)Math.Cos(angle1), (float)Math.Sin(angle1));
            direction3 = new Vector2((float)Math.Cos(angle3), (float)Math.Sin(angle3));

            ProjectileHandler projectileHandler = ProjectileHandler.Instance;

            projectileHandler.CreateFireballObject(spriteBatch, location, direction1);
            projectileHandler.CreateFireballObject(spriteBatch, location, direction2);
            projectileHandler.CreateFireballObject(spriteBatch, location, direction3);

            SoundFactory.PlaySound(SoundFactory.Instance.bossScream);
        }
        private void LoadFireballs()
        {
            //the direction the fireballs will travel
            Vector2 direction1;
            Vector2 direction2;
            Vector2 direction3;

            //all fireballs originate in the mouth
            Vector2 location;

            location.X  = this.center.X;
            location.X += 3 * MovementConstants.AquamentusFireballChangeX;
            location.Y  = this.center.Y - 10;

            direction2 = player.Center - location;
            direction2.Normalize();
            double angle2 = Math.Atan2(direction2.Y, direction2.X);
            double angle1 = angle2 + MovementConstants.BoggusFireballSpreadAngle;
            double angle3 = angle2 - MovementConstants.BoggusFireballSpreadAngle;

            direction1 = new Vector2((float)Math.Cos(angle1), (float)Math.Sin(angle1));
            direction3 = new Vector2((float)Math.Cos(angle3), (float)Math.Sin(angle3));

            ProjectileHandler projectileHandler = ProjectileHandler.Instance;

            projectileHandler.CreateFireballObject(spriteBatch, location, direction1);
            projectileHandler.CreateFireballObject(spriteBatch, location, direction2);
            projectileHandler.CreateFireballObject(spriteBatch, location, direction3);
        }
示例#3
0
        private void LoadFireballs()
        {
            //the direction the fireballs will travel
            Vector2 direction;

            //all fireballs originate in the mouth
            Vector2 location;

            location.X = this.center.X;
            location.Y = this.center.Y - 10;

            direction = player.Center - location;
            direction.Normalize();

            location.X += -15; //originate fireballs at mouth if facing left

            ProjectileHandler projectileHandler = ProjectileHandler.Instance;

            projectileHandler.CreateFireballObject(spriteBatch, location, direction);
        }