Beispiel #1
0
        static void Main(string[] args)
        {
            // Set up the startup path of the application.
            StartupPath = System.AppDomain.CurrentDomain.BaseDirectory;

            // Check the folders and files in the system.
            FolderSystem.Check();

            // Load the game data.
            DataManager.Load();

            // Start the network.
            NetworkManager.Initialize();

            // Initialize the scripting system.
            ScriptManager.Initialize();

            // Set up the Destroy Server event handlers.
            Console.WriteLine("[IMPORTANT INFORMATION] : ");
            Console.WriteLine("------------------------------------------------------------------------------");
            Console.WriteLine("Remember to turn off the server by pressing [CTRL + C] or [CTRL + BREAK].");
            Console.WriteLine("If you do not, all online player's data will NOT be saved.");
            Console.WriteLine("------------------------------------------------------------------------------");
            Console.CancelKeyPress += (s, e) => {
                Destroy();
            };

            //new Form1().Show();

            // Start the gameloop.
            GameLoop();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            // Set up the startup path of the application.
            StartupPath = System.AppDomain.CurrentDomain.BaseDirectory;

            // Check the folders and files in the system.
            FolderSystem.Check();

            // Initialize the game form.
            Window = new GameWindow(960, 640);

            // Initialize the event-handlers and properties.
            Window.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            Window.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
            Window.MaximizeBox     = false;
            Window.FormClosing    += (sender, e) => {
                switch (Program.State)
                {
                case (int)GameState.Wait:
                case (int)GameState.Main:
                    NetworkManager.PacketManager.SendRequestChangeClientState(GameState.Login);
                    break;

                case (int)GameState.Loading:
                    // Do nothing.
                    break;

                case (int)GameState.Game:
                    NetworkManager.PacketManager.SendRequestChangeClientState(GameState.Main);
                    break;

                default:
                    Running = false;
                    break;
                }

                e.Cancel = true;
            };

            // Load the game data.
            DataManager.Load();

            // Initialize the game graphics.
            GraphicsManager.Initialize();

            // Start the network.
            NetworkManager.Initialize();

            // Start the gameloop.
            GameLoop();
        }
Beispiel #3
0
        // The main point of entry for the application.
        private static void Main(string[] args)
        {
            // Check the folders and files in the system.
            FolderSystem.Check();

            // Load the game data.
            DataManager.Load();

            // Initialize the audio system.
            AudioManager.Initialize();

            // Initialize the game graphics.
            GraphicsManager.Initialize();

            // Start the game-loop.
            TowerDefense.GameLoop();
        }
Beispiel #4
0
        // The main point of entry for the application.
        private static void Main(string[] args)
        {
            // Check the folders and files in the system.
            FolderSystem.Check();

            // Load the game data.
            DataManager.Load();

            // Initialize the audio system.
            AudioManager.Initialize();
            AudioManager.Player.PlayMusic("McGameJam.flac", true);

            // Initialize the game graphics.
            GraphicsManager.Initialize();

            // Start the game-loop.
            Game.GameLoop();
        }
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();

            // Check the folders and files in the system.
            FolderSystem.Check();

            // Load the client data.
            DataManager.Load();

            // Start the network.
            NetworkManager.Initialize();

            // Initialize the plugin manager.
            PluginManager.Initialize();

            // Initialize the scripting system.
            ScriptManager.Initialize();

            Application.Run(Window);
        }