private void NotificationFromScene(object sender) { _runningScene.Exit(); if (sender == _gameScene) { _runningScene = _menuScene; } else if (sender == _menuScene) { _runningScene = _gameScene; } _runningScene.Show(); }
public MainForm() { InitializeComponent(); _menuScene = new MenuScene(this); _menuScene.Notification += NotificationFromScene; _gameScene = new GameScene(this); _gameScene.Notification += NotificationFromScene; _runningScene = _menuScene; _runningScene.Show(); _frameRateTimer.Start(); Application.Idle += HandleApplicationIdle; }