Пример #1
0
        /// <summary>
        /// Creates the moon boss. 
        /// </summary>
        /// <param name="id"></param>
        /// <param name="content">A Content manager</param>
        /// <param name="position"></param>
        public MoonBoss(uint id, ContentManager content, Vector2 position)
            : base(id)
        {
            Health = 600;
            this.position = position;
            CC = new MBCloseC(id, content, position);
            spritesheet = content.Load<Texture2D>("Spritesheets/MoonBoss.png");

            spriteBounds[(int)MBState.Full].X = 0;
            spriteBounds[(int)MBState.Full].Y = 0;
            spriteBounds[(int)MBState.Full].Width = 119;
            spriteBounds[(int)MBState.Full].Height = 140;

            spriteBounds[(int)MBState.Half].X = 0;
            spriteBounds[(int)MBState.Half].Y = 0;
            spriteBounds[(int)MBState.Half].Width = 119;
            spriteBounds[(int)MBState.Half].Height = 140;

            spriteBounds[(int)MBState.AD].X = 119;
            spriteBounds[(int)MBState.AD].Y = 0;
            spriteBounds[(int)MBState.AD].Width = 108;
            spriteBounds[(int)MBState.AD].Height = 140;

            state = MBState.Full;
        }
Пример #2
0
        /// <summary>
        /// This creates the gun on the boss.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="content"></param>
        /// <param name="position"></param>
        public MBCloseC(uint id, ContentManager content, Vector2 position)
            : base(id)
        {
            this.position = position;
            Health = 600;

            spritesheet = content.Load<Texture2D>("Spritesheets/newshb.shp.000000");

            spriteBounds[(int)CCState.none].X = 0;
            spriteBounds[(int)CCState.none].Y = 140;
            spriteBounds[(int)CCState.none].Width = 48;
            spriteBounds[(int)CCState.none].Height = 28;

            spriteBounds[(int)CCState.close].X = 0;
            spriteBounds[(int)CCState.close].Y = 168;
            spriteBounds[(int)CCState.close].Width = 48;
            spriteBounds[(int)CCState.close].Height = 28;

            spriteBounds[(int)CCState.fire].X = 0;
            spriteBounds[(int)CCState.fire].Y = 196;
            spriteBounds[(int)CCState.fire].Width = 48;
            spriteBounds[(int)CCState.fire].Height = 28;

            state = MBState.Full;
            cs = CCState.none;
        }
Пример #3
0
        /// <summary>
        /// Creates the moon boss.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="content">A Content manager</param>
        /// <param name="position"></param>
        public MoonBoss(uint id, ContentManager content, Vector2 position)
            : base(id)
        {
            Health        = 600;
            this.position = position;
            CC            = new MBCloseC(id, content, position);
            spritesheet   = content.Load <Texture2D>("Spritesheets/MoonBoss.png");

            spriteBounds[(int)MBState.Full].X      = 0;
            spriteBounds[(int)MBState.Full].Y      = 0;
            spriteBounds[(int)MBState.Full].Width  = 119;
            spriteBounds[(int)MBState.Full].Height = 140;

            spriteBounds[(int)MBState.Half].X      = 0;
            spriteBounds[(int)MBState.Half].Y      = 0;
            spriteBounds[(int)MBState.Half].Width  = 119;
            spriteBounds[(int)MBState.Half].Height = 140;

            spriteBounds[(int)MBState.AD].X      = 119;
            spriteBounds[(int)MBState.AD].Y      = 0;
            spriteBounds[(int)MBState.AD].Width  = 108;
            spriteBounds[(int)MBState.AD].Height = 140;

            state = MBState.Full;
        }
Пример #4
0
        /// <summary>
        /// This creates the gun on the boss.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="content"></param>
        /// <param name="position"></param>
        public MBCloseC(uint id, ContentManager content, Vector2 position)
            : base(id)
        {
            this.position = position;
            Health        = 600;

            spritesheet = content.Load <Texture2D>("Spritesheets/newshb.shp.000000");

            spriteBounds[(int)CCState.none].X      = 0;
            spriteBounds[(int)CCState.none].Y      = 140;
            spriteBounds[(int)CCState.none].Width  = 48;
            spriteBounds[(int)CCState.none].Height = 28;

            spriteBounds[(int)CCState.close].X      = 0;
            spriteBounds[(int)CCState.close].Y      = 168;
            spriteBounds[(int)CCState.close].Width  = 48;
            spriteBounds[(int)CCState.close].Height = 28;

            spriteBounds[(int)CCState.fire].X      = 0;
            spriteBounds[(int)CCState.fire].Y      = 196;
            spriteBounds[(int)CCState.fire].Width  = 48;
            spriteBounds[(int)CCState.fire].Height = 28;

            state = MBState.Full;
            cs    = CCState.none;
        }
Пример #5
0
        /// <summary>
        /// Updates the moon boss
        /// </summary>
        /// <param name="elapsedTime">Time elapsed</param>
        public override void Update(float elapsedTime)
        {
            if (Health <= 300)
            {
                state = MBState.Half;
            }
            else if (Health <= 100)
            {
                state = MBState.AD;
            }

            if (dgt1 >= 2f)
            {
                dgt1 = 0;
                rc1  = 0;
            }
            else if (rc1 >= 3f)
            {
                ScrollingShooterGame.GameObjectManager.CreateProjectile(ProjectileType.Laser, Vector2.Zero);
                dgt1 += elapsedTime;
            }
            else if (rc1 < 3f)
            {
                rc1 += elapsedTime;
            }
            if (dgt2 >= 2.4f)
            {
                dgt2 = 0;
            }
            else if (rc2 >= 3f)
            {
                ScrollingShooterGame.GameObjectManager.CreateProjectile(ProjectileType.Laser, Vector2.Zero);
                dgt2 += elapsedTime;
            }
            else if (rc2 < 3f)
            {
                rc2 += elapsedTime;
            }
            CC.Update(elapsedTime);
        }
Пример #6
0
        /// <summary>
        /// Updates the moon boss
        /// </summary>
        /// <param name="elapsedTime">Time elapsed</param>
        public override void Update(float elapsedTime)
        {
            if (Health <= 300)
            {
                state = MBState.Half;
            }
            else if (Health <= 100)
            {
                state = MBState.AD;
            }

            if (dgt1 >= 2f)
            {
                dgt1 = 0;
                rc1 = 0;
            }
            else if (rc1 >= 3f)
            {
                ScrollingShooterGame.GameObjectManager.CreateProjectile(ProjectileType.Laser, Vector2.Zero);
                dgt1 += elapsedTime;
            }
            else if(rc1 < 3f)
            {
                rc1 += elapsedTime;
            }
            if (dgt2 >= 2.4f)
            {
                dgt2 = 0;
            }
            else if( rc2 >= 3f)
            {
                ScrollingShooterGame.GameObjectManager.CreateProjectile(ProjectileType.Laser, Vector2.Zero);
                dgt2 += elapsedTime;
            }
            else if (rc2 < 3f)
            {
                rc2 += elapsedTime;
            }
            CC.Update(elapsedTime);
        }
Пример #7
0
        /// <summary>
        /// Updates the moon boss
        /// </summary>
        /// <param name="elapsedTime">Time elapsed</param>
        public override void Update(float elapsedTime)
        {
            if (-ScrollingShooterGame.LevelManager.scrollDistance / 2 <= position.Y - 10) ScrollingShooterGame.LevelManager.Scrolling = false;

            if (Health <= 300)
            {
                state = MBState.Half;
            }
            else if (Health <= 100)
            {
                state = MBState.AD;
            }

            if (dgt1 >= 2f)
            {
                dgt1 = 0;
                rc1 = 0;
            }
            else if (rc1 >= 3f)
            {
                ScrollingShooterGame.GameObjectManager.CreateProjectile(ProjectileType.Laser, Vector2.Zero);
                dgt1 += elapsedTime;
            }
            else if(rc1 < 3f)
            {
                rc1 += elapsedTime;
            }
            if (dgt2 >= 2.4f)
            {
                dgt2 = 0;
            }
            else if( rc2 >= 3f)
            {
                ScrollingShooterGame.GameObjectManager.CreateProjectile(ProjectileType.Laser, Vector2.Zero);
                dgt2 += elapsedTime;
            }
            else if (rc2 < 3f)
            {
                rc2 += elapsedTime;
            }
            CC.Update(elapsedTime);
            CC.Health = Health;
        }