Exemple #1
0
        public static void Main()
        {
            SwinGame.OpenGraphicsWindow("Battle Ships", 800, 600);

            GameResources.LoadResources();
            Audio.PlayMusic(GameResources.GameMusic("Background"));
            do
            {
                GameController.HandleUserInput();
                GameController.DrawScreen();
                if (GameController.CurrentState == GameState.Quitting)
                {
                    break;
                }
            }while (!SwinGame.WindowCloseRequested() == true | GameController.CurrentState == GameState.Quitting);
            SwinGame.StopMusic();
            GameResources.FreeResources();
        }
Exemple #2
0
        public static void Main()
        {
            // Opens a new Graphics Window
            SwinGame.OpenGraphicsWindow("Battle Ships", 800, 600);
            // Load Resources
            GameResources.LoadResources();
            SwinGame.PlayMusic(GameResources.GameMusic("Background"));
            // Game Loop
            do
            {
                GameController.HandleUserInput();
                GameController.DrawScreen();
            } while (!((SwinGame.WindowCloseRequested() == true) || (GameController.CurrentState == GameState.Quitting)));

            SwinGame.StopMusic();
            // Free Resources and Close Audio, to end the program.
            GameResources.FreeResources();
        }