Exemplo n.º 1
0
        private void NotificationFromScene(object sender)
        {
            _runningScene.Exit();

            if (sender == _gameScene)
            {
                _runningScene = _menuScene;
            }
            else if (sender == _menuScene)
            {
                _runningScene = _gameScene;
            }

            _runningScene.Show();
        }
Exemplo n.º 2
0
        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;
        }