Ejemplo n.º 1
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>

        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }

            // TODO: Add your update logic here
            TheProjectileManager.Update(Areas.Locations[0].Width, Areas.Locations[0].Height, Areas.Locations[0].Zones, Areas.Locations[0].Enemies, Areas.Locations[0].ObjectZones);
            TheMainCharacter.Move();
            TheMainCharacter.BoundsCheck(TheCamera, Areas.Locations[0].Width, Areas.Locations[0].Height);
            Areas.Locations[0].Update(TheCamera);
            TheMainCharacter.ObjectCollisions(Areas.Locations[0], TheCamera);
            TheMainCharacter.EnemyCollisions(Areas.Locations[0], TheCamera);
            TheMainCharacter.UpdateBox();
            TheCursor.SetMouse(TheMainCharacter, TheProjectileManager, gameTime);
            TheMainCharacter.Aim(gameTime);
            base.Update(gameTime);
        }