private void TimerTick(object obj, EventArgs e) { _timer.Stop(); if (_gameMenu != null) { _gameMenu.Show(); } if (_game != null) { _game.Tick(PBGame.PointToClient(MousePosition)); _game.Render(); if (_game.Lose || _game.Won) { //_timer.Stop(); MessageBox.Show(_game.Lose ? GameCoClassLibrary.Properties.Resources.Looser_message : GameCoClassLibrary.Properties.Resources.Winner_message); float scaling = _game.Scaling; _game = null; _gameMenu = new MainMenu(_graphObject); GameResize(scaling); //_timer.Start(); return; } } _graphObject.Render(); _timer.Start(); }
/// <summary> /// Called when the frame is rendered. /// </summary> /// <param name="e">Contains information necessary for frame rendering.</param> protected override void OnRenderFrame(FrameEventArgs e) { base.OnRenderFrame(e); if (_gameMenu != null) { _gameMenu.Show(); } if (_game != null) { _game.Render(); } _graphObject.Render(); SwapBuffers(); }