Exemple #1
0
        /// <summary>
        /// update game logic
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            level.Update(gameTime);

            background.Update(level.Player.Direction, level.CamType);

            //fade out black overlay
            if (col.A > 0)
            {
                col *= .9999999f;
            }

            if (col.A == 0 && showDbox)
            {
                dbox.IsActive = true;
                showDbox      = false;
            }

            dbox.Update(gameTime);

            if (dbox.Finished)
            {
                ScreenManager.ChangeScreens(this, new LevelScreen());
            }


            base.Update(gameTime);
        }
Exemple #2
0
        /// <summary>
        /// update game logic
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            level.Update(gameTime);
            background.Update(level.Player.Direction, level.CamType);

            dbox.Update(gameTime);
            if (dbox.IsActive)
            {
                level.Player.MovementEnabled = false;
            }
            else
            {
                level.Player.MovementEnabled = true;
            }

            //open dbox if ted interacts with friends
            if (level.Player.BoundingRectangle.Intersects(friendBoundingBox))
            {
                dbox.IsActive = true;
            }

            //load next screen when done
            if (dbox.Finished)
            {
                SoundManager.PlaySound("portal", 1f);
                ScreenManager.ChangeScreens(this, new WakeUpScreen());
            }
            base.Update(gameTime);
        }
Exemple #3
0
        /// <summary>
        /// update game logic
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            level.Update(gameTime);

            background.Update(level.Player.Direction, level.CamType);

            dbox.Update(gameTime);
            if (dbox.IsActive)
            {
                level.Player.MovementEnabled = false;
            }
            else
            {
                level.Player.MovementEnabled = true;
            }



            if (level.Player.BoundingRectangle.Intersects(leftBound))
            {
                ScreenManager.ChangeScreens(this, new Ending2Screen());
            }
            else if (level.Player.BoundingRectangle.Intersects(rightBound))
            {
                ScreenManager.ChangeScreens(this, new Ending1Screen());
            }

            base.Update(gameTime);
        }
Exemple #4
0
        /// <summary>
        /// update logic
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            level.Update(gameTime);

            dbox.Update(gameTime);
            dbox2.Update(gameTime);
            if (dbox.IsActive || dbox2.IsActive)
            {
                level.Player.MovementEnabled = false;
            }
            else
            {
                level.Player.MovementEnabled = true;
            }

            background.Update(level.Player.Direction, level.CamType);

            //start 2nd dbox when at the cave
            if (level.Player.BoundingRectangle.Intersects(caveBounds))
            {
                dbox2.IsActive = true;
            }

            //when dbox2 is done
            if (dbox2.Finished)
            {
                ScreenManager.ChangeScreens(this, new CaveScreen());
            }

            base.Update(gameTime);
        }
Exemple #5
0
        /// <summary>
        /// update boss logic
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            level.Update(gameTime);
            background.Update(level.Player.Direction, level.CamType);

            timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
            //shoot different group at 4 secs
            if (timer >= 4f)
            {
                switch (projectileTurn)
                {
                case 0:
                    LaunchProjectiles(boss.Projectiles2);
                    break;

                case 1:
                    LaunchProjectiles(boss.Projectiles);
                    break;

                case 2:
                    LaunchProjectiles(boss.Projectiles3);
                    break;
                }

                timer = -2.0f;                //set to -2 to account for the powerdown time of the animation
            }

            boss.CheckProjectileDamage();

            dbox.Update(gameTime);
            if (dbox.IsActive)
            {
                level.Player.MovementEnabled = false;
            }
            else
            {
                level.Player.MovementEnabled = true;
            }



            if (level.Player.Position.Y > 1020 || level.Player.IsDead)
            {
                ScreenManager.ChangeScreens(this, new DeathScreen());
            }

            if (boss.Health.IsDead)
            {
                SoundManager.StopAll();
                level.SetPortalState(true);
            }

            if (level.ExitReached)
            {
                ScreenManager.ChangeScreens(this, new LevelScreen());
            }

            base.Update(gameTime);
        }
Exemple #6
0
        /// <summary>
        /// update game logic
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            background.Update(level.Player.Direction, level.CamType);

            dbox.Update(gameTime);
            if (dbox.IsActive)
            {
                bossCam.Enabled = false;
            }
            else
            {
                bossCam.Enabled = true;
            }

            level.Update(gameTime);
            bossCam.Update();

            SetEyePositions();

            timer += (float)gameTime.ElapsedGameTime.TotalSeconds;

            //launch the projectiles ever 8 seconds
            if (timer >= 8f)
            {
                SoundManager.PlaySound("loudwall", 1f);
                boss.LaunchAllProjectiles();
                timer = 0f;
            }

            //trigger to the next screen when player falls down hole
            if (level.Player.Position.Y > 1000)
            {
                ScreenManager.ChangeScreens(this, new LevelScreen());
            }

            //check if player has died
            if (level.Player.IsDead)
            {
                ScreenManager.ChangeScreens(this, new DeathScreen());
            }


            base.Update(gameTime);
        }