示例#1
0
        //This is the method that will be called over and over by the thread
        public void GameUpdate()
        {
            //This method is running on a seperate thread, thus wont create
            //any lag for the windowwhen using while(true)
            while (Running)
            {
                //TODO: add game update code

                manager.Update();

                //NOTE: the screen should always be drawn to after update has finished
                DrawScreen.Redraw();

                //This slows the thread.
                //Idealy in a proper game engine you want thread Stabiliziation :P
                Thread.Sleep(12);
            }
        }