static void Main() { GameSettings gameSettings = new GameSettings(); ScreenFactory screenFactory = InitScreenFactory(gameSettings); MainScreen mainScreen = screenFactory.CreateMainScreen(); KeyReceiver keyReceiver = new KeyReceiver(); KeyListener keyListener = new KeyListener(keyReceiver); Engine engine = new Engine(gameSettings.FPS, mainScreen, keyReceiver); keyListener.Start(); engine.Start(); while (engine.Started) { engine.Loop(); } keyListener.Stop(); }
protected override void OnPick(string selection, Engine engine) { engine.SwitchScreen(_screenFactory.CreateMainScreen()); }