private void CreatePhysicsManager()
 {
     physicsManager = new PhysicsManager();
     physicsManager.AddMoveableBody(player);
     physicsManager.SetStaticBodies(mapBuilder.GetCollisionRectangles());
     physicsManager.SetStaticSpikes(mapBuilder.GetSpikes());
 }
        public override void Update(GameTime gameTime)
        {
            //Effects management
            playerEffectsManager.Update(gameTime);
            //After updating player effects manager
            //Player reference might change (he can be packed or unpacked)
            //We're updating the reference in GameState and in PhysicsManager
            physicsManager.DeleteBody(player);
            player = playerEffectsManager.GetDecoratedPlayer();
            physicsManager.AddMoveableBody(player);

            camera.Update(gameTime);
            physicsManager.Update(gameTime);
            CheckForLevelComplete();
            foreach (var c in gameComponents)
            {
                c.Update(gameTime);
            }
            if (player.MoveableBodyState == MoveableBodyStates.Dead)
            {
                foreach (var c in gameOverComponents)
                {
                    c.Hidden = false;
                }
                if (inputManager.ActionWasJustPressed("Attack"))
                {
                    Type type = this.GetType();
                    game.ChangeState((GameState)Activator.CreateInstance(type, game));
                }
            }
            else
            {
                foreach (var c in gameOverComponents)
                {
                    c.Hidden = true;
                }
            }
            CheckForBackToMenuInput();
            base.Update(gameTime);
        }