示例#1
0
        static void Main(string[] args)
        {
            RenderWindow window = new RenderWindow(new VideoMode(1600, 900), "Game Window");

            window.SetFramerateLimit(60);
            bool quit = false;

            MenuManager = new MenuManager(window);
            while (!quit && window.IsOpen)
            {
                switch (MenuManager.menu)
                {
                case 0:
                    MenuManager.HandleMenu(window);
                    break;

                case 1:
                    MenuManager.RemoveListeners(window);
                    PlaySingleGame(window, true);
                    MenuManager.AddListeners(window);
                    break;

                case 2:
                    MenuManager.RemoveListeners(window);
                    PlaySingleGame(window, false);
                    MenuManager.AddListeners(window);
                    break;

                case 3:
                    MenuManager.RemoveListeners(window);
                    PlayMultiGame(window, true);
                    MenuManager.AddListeners(window);
                    break;

                case 4:
                    MenuManager.RemoveListeners(window);
                    PlayMultiGame(window, false);
                    MenuManager.AddListeners(window);
                    break;

                default:
                    quit = true;
                    break;
                }
            }
        }