Esempio n. 1
0
            new public void Update()
            {
                Application.DoEvents();
                base.Update();
                if (FrameRateController.ProceedToNextFrame)    //If we can move onto the next frame
                {
                    for (int i = 0; i < KeyBuffer.Length; i++) //Copy the asynchronous buffer into the synchronous one
                    {
                        KeysCurrentFrame[i] = KeyBuffer[i];
                    }
                    this.Invalidate(); //Invalidate the current image. This calls the Game_Paint event
                    if (CurrentState != null)
                    {
                        CurrentState.Update();                      //Update the current GameState
                    }
                    FrameRateController.ProceedToNextFrame = false; //Notify the FramerateController that the frame has been executed

                    for (int i = 0; i < KeysLastFrame.Length; i++)  //Copy the synchronous buffer into the previous frame buffer
                    {
                        KeysLastFrame[i] = KeysCurrentFrame[i];
                    }
                }
            }
Esempio n. 2
0
 public void Update(GameTime gameTime)
 {
     State.Update(gameTime);
     Input.Update(gameTime);
 }