Load() public method

Loads the level from a descriptive script file on the harddrive.
public Load ( string newLevel, string oldLevel, Pantheon gameReference ) : void
newLevel string
oldLevel string
gameReference Pantheon
return void
示例#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)
        {
            CutsceneManager.Update(gameTime, this);

            ControlManager.Update();

            // REMOVE LATER
            if (Keyboard.GetState().IsKeyDown(Keys.Back)) { this.Exit(); }

            if (ControlManager.actions.Pause)
            {
                this.IsMouseVisible = true;
                menu.Update(gameTime, this);
            }
            else
            {
                menu.MenuState = "main";

                this.IsMouseVisible = false;

                if (currentLevel.LevelPlaying)
                {
                    if (!CutsceneManager.CutscenePlaying)
                    {
                        currentLevel.Update(gameTime, this);
                    }
                }
                else
                {
                    string nextLevel = currentLevel.NextLevel;
                    string prevLevel = currentLevel.LevelNum;
                    currentLevel = new Level(GraphicsDevice);
                    currentLevel.Load(nextLevel, prevLevel, this);
                }

                hud.Update(gameTime, this, this.currentLevel);
            }

            base.Update(gameTime);
        }