예제 #1
0
        public static void Main()
        {
            //Open the game window
            SwinGame.OpenGraphicsWindow("Battle Ships", 800, 600);
            //SwinGame.ShowSwinGameSplashScreen();

            //Load Resources
            GameResources.LoadResources();

            GameController.PlayMusic();

            //Run the game loop
            while (!(true == SwinGame.WindowCloseRequested() || GameController.CurrentState == GameState.Quitting))
            {
                GameController.HandleUserInput();
                GameController.DrawScreen();
            }

            SwinGame.StopMusic();

            GameResources.FreeResources();
        }
예제 #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();
        }
예제 #3
0
 // '' <summary>
 // '' Listens to the game grids for any changes and redraws the screen
 // '' when the grids change
 // '' </summary>
 // '' <param name="sender">the grid that changed</param>
 // '' <param name="args">not used</param>
 private static void GridChanged(object sender, EventArgs args)
 {
     GameController.DrawScreen();
     SwinGame.RefreshScreen();
 }