Пример #1
0
        private void tmrGameUpdate_Tick(object sender, EventArgs e)
        {
            tmrGameUpdate.Interval = Math.Max(1, 1000 / StaticDisplay.FPSCap);

            StaticDisplay.Begin();
            {
                if (StaticEngine.IsGameRunning)
                {
                    StaticEngine.CurrentGame.Update();
                }
                else // Update Splash-Screen
                {
                    StaticEngine.CurrentGame.UpdateSplash();
                }
                Refresh();
            }
            StaticDisplay.End();
            StaticMouse.ResetDelta(); // Reset delta values

            // Goes back to GameMenu when game requested to stop
            if (StaticEngine.CurrentGame.IsStopRequested())
            {
                StaticEngine.ChangeGame(null, GameMode.SINGLEPLAYER);
            }
        }
Пример #2
0
 private void Display_Resize(object sender, EventArgs e)
 {
     StaticDisplay.InvokeResizeListener(ClientSize, sender, e);
     Refresh(); // Refresh screen when resizing
 }