Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #7
0
        /// <summary>
        /// update game logic
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            background.Update(level.Player.Direction, level.CamType);

            level.Update(gameTime);

            boss.Position += velocity;

            boss.BoundingRect = new Rectangle((int)boss.Position.X, (int)boss.Position.Y, 140, 220);
            boss.Health.UpdateCooldownTimer(gameTime);

            boss.CheckProjectileDamage();

            if (boss.BoundingRect.Intersects(leftBound) || boss.BoundingRect.Intersects(rightBound))
            {
                velocity *= -1;
            }

            timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
            if (timer >= 6f)
            {
                boss.LaunchAllProjectiles();
                //timer = 0f;
            }

            if (timer >= 8)
            {
                SoundManager.PlaySound("skeletonlaugh", 1f);
                timer = 0;
            }
            //load next screen upon boss death
            if (boss.Health.IsDead)
            {
                ScreenManager.ChangeScreens(this, new EpilogueScreen());
            }

            //if player dies
            if (level.Player.Health.IsDead)
            {
                ScreenManager.ChangeScreens(this, new DeathScreen());
            }

            base.Update(gameTime);
        }
Пример #8
0
        /// <summary>
        /// update game logic
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            if (!showTitle)
            {
                enemy.Update(gameTime);
            }

            background.Update(Player.Direction, CamType);

            if (ExitReached && LevelIndex < 2)
            {
                LevelIndex++;
                Reset(indexToLevel(GroupIndex, LevelIndex));
                ExitReached = false;

                LevelData levelData = LevelData.Load();
                levelData.GroupIndex = GroupIndex;
                levelData.LevelIndex = LevelIndex;
                levelData.Save();
            }
            else if (ExitReached && LevelIndex >= 2)
            {
                GroupDone = true;
            }

            shadowCam.Update();

            if (showTitle)
            {
                shadowCam.Enabled = false;
            }
            else
            {
                shadowCam.Enabled = true;
            }


            base.Update(gameTime);
        }