Ejemplo n.º 1
0
        public void Processing()
        {
            formMainMenu menu = new formMainMenu
            {
                mainGame = MainProcessManager.mainGame
            };

            mainGame.Player.currentPlaylist.clear();
            WMPLib.IWMPMedia media;
            string[]         filePaths = Directory.GetFiles("GameMusic/Start/", "*.mp3");
            Random           rd        = new Random();
            int    index = rd.Next(0, filePaths.Length);
            string path  = filePaths[index];

            foreach (String s in filePaths)
            {
                media = mainGame.Player.newMedia(s);
                mainGame.Player.currentPlaylist.appendItem(media);
            }
            media = mainGame.Player.newMedia(path);
            mainGame.Player.currentPlaylist.appendItem(media);
            mainGame.Player.currentItem = media;
            mainGame.Player.play();
            mainGame.Player.settings.setMode("loop", true);

            if (menu.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.globalVariables.InitialGlobalVariables();
                this.gameParameters.InitializeGameParameters();

                mainGame.jiazaitishi.Show();
                mainGame.jiazaitishi.Refresh();
                mainGame.Run();
            }
        }
Ejemplo n.º 2
0
        public void Processing()
        {
            formMainMenu menu = new formMainMenu
            {
                mainGame = mainGame
            };

            if (menu.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.globalVariables.InitialGlobalVariables();
                this.gameParameters.InitializeGameParameters();
                mainGame.jiazaitishi.Show();
                mainGame.Run();
            }
        }
        public void Processing()
        {
            formMainMenu menu = new formMainMenu
            {
                mainGame = MainProcessManager.mainGame
            };

            mainGame.Player.URL = @"GameMusic\Start.mp3";
            mainGame.Player.play();
            if (menu.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.globalVariables.InitialGlobalVariables();
                this.gameParameters.InitializeGameParameters();

                mainGame.jiazaitishi.Show();
                mainGame.jiazaitishi.Refresh();
                mainGame.Run();
            }
        }