예제 #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)
 {
     if (!startGame)
     {
         mK.Update(gameTime);
         if (inputDef.CheckInput(Controls.Deselect))
         {
             if (currentPage == "MainMenu")
             {
                 Exit();
             }
             else
             {
                 LoadCanvas("MainMenu.ss", 0);
             }
         }
         canv.Update(gameTime);
         // TODO: Add your update logic here
         if (inputDef.CheckInput(Controls.Select))
         {
             Button button = canv.CheckClick(mK.InputPos.ToPoint(), inputDef, Pages);
             if (button is StartButton)
             {
                 PlayedGame.StartGame();
                 startGame = true;
             }
             else if (button is PageButton)
             {
                 currentPage = button.Text;
                 LoadCanvas(((PageButton)button).path, ((PageButton)button).PageOrder);
             }
         }
         inputDef.Update(gameTime);
     }
     else if (PlayedGame != null)
     {
         PlayedGame.Update(gameTime);
     }
     base.Update(gameTime);
 }
예제 #2
0
 public void Update(GameTime gameTime)
 {
     input.Update(gameTime);
 }