コード例 #1
0
ファイル: PauseMenuScript.cs プロジェクト: GDxU/GoalRush
        public override void Start()
        {
            var lastMatchSession = Game.GameSession.MatchSessions.Last();

            m_newMatchInfo                   = new MatchStartInfo();
            m_newMatchInfo.Arena.Name        = lastMatchSession.MatchInfo.Arena.Name;
            m_newMatchInfo.Arena.ColorScheme = lastMatchSession.MatchInfo.Arena.ColorScheme;
            m_newMatchInfo.Players           = new PlayerInfo[4];
            m_newMatchInfo.Players[0]        = lastMatchSession.MatchInfo.Players[0];
            m_newMatchInfo.Players[1]        = lastMatchSession.MatchInfo.Players[1];
            m_newMatchInfo.Players[2]        = lastMatchSession.MatchInfo.Players[2];
            m_newMatchInfo.Players[3]        = lastMatchSession.MatchInfo.Players[3];
            m_newMatchInfo.Teams             = new TeamInfo[2];
            m_newMatchInfo.Teams[0]          = lastMatchSession.MatchInfo.Teams[0];
            m_newMatchInfo.Teams[1]          = lastMatchSession.MatchInfo.Teams[1];

            m_screenFade = new ScreenFade();
            Menu.Owner.Attach(m_screenFade);

            m_screenFade.Opacity = 0.7f;
            m_screenFade.StartFade(ScreenFade.FadeType.FadeIn, 0, false);

            m_matchRestartTimer         = new Timer(Engine.GameTime.Source, 200);
            m_matchRestartTimerEvent    = new TimerEvent(m_matchRestartTimer_OnTime);
            m_matchRestartTimer.OnTime += m_matchRestartTimerEvent;

            //Game.GameMusic.Tracks["MatchStream"].Pause();
        }
コード例 #2
0
        private void StartAIDemo()
        {
            if (m_AIGameData.IsIdleAIRunning)
            {
                return;
            }

            m_AIGameData.IsIdleAIRunning = true;
            m_AIGameData.IdleTimeMS      = 0;

            Engine.Log.Write("StartAIDemo");

            var colorSchemeDataAsset = Engine.AssetManager.GetAsset <ColorSchemeData>("Game/Colors.lua::ColorShemeArenas");
            var colorSchemeTeamAsset = Engine.AssetManager.GetAsset <ColorSchemeData>("Game/Colors.lua::ColorShemeTeams");

            var matchStartInfo = new MatchStartInfo();

            matchStartInfo.Arena.Name        = "ArenaLarge";
            matchStartInfo.Arena.ColorScheme = colorSchemeDataAsset.Content.ColorSchemes[0];

            var iColorIdx1 = Engine.Random.Next(0, 2);
            var iColorIdx2 = Engine.Random.Next(3, 5);

            matchStartInfo.Teams[0].ColorScheme = colorSchemeTeamAsset.Content.ColorSchemes[iColorIdx1];
            matchStartInfo.Teams[1].ColorScheme = colorSchemeTeamAsset.Content.ColorSchemes[iColorIdx2];

            if (Game.MenuManager.CurrentMenu != null)
            {
                Game.MenuManager.QuitMenu();
            }

            Game.GameManager.StartMatch(matchStartInfo);
        }
コード例 #3
0
ファイル: MatchEndScript.cs プロジェクト: GDxU/GoalRush
        public override void Start()
        {
            var backgroundCmp = new SpriteComponent(Sprite.CreateFromTexture("Graphics/Menu/Background.png"), "MenuBackground");

            Menu.Owner.Attach(backgroundCmp);

            Game.GameManager.EndMatch();

            var lastMatchSession = Game.GameSession.MatchSessions.Last();

            m_newMatchInfo                          = new MatchStartInfo();
            m_newMatchInfo.Arena.Name               = lastMatchSession.MatchInfo.Arena.Name;
            m_newMatchInfo.Arena.ColorScheme        = lastMatchSession.MatchInfo.Arena.ColorScheme;
            m_newMatchInfo.Players                  = new PlayerInfo[4];
            m_newMatchInfo.Players[0]               = lastMatchSession.MatchInfo.Players[0];
            m_newMatchInfo.Players[1]               = lastMatchSession.MatchInfo.Players[1];
            m_newMatchInfo.Players[2]               = lastMatchSession.MatchInfo.Players[2];
            m_newMatchInfo.Players[3]               = lastMatchSession.MatchInfo.Players[3];
            m_newMatchInfo.Teams                    = new TeamInfo[2];
            m_newMatchInfo.Teams[0]                 = lastMatchSession.MatchInfo.Teams[0];
            m_newMatchInfo.Teams[1]                 = lastMatchSession.MatchInfo.Teams[1];
            m_newMatchInfo.Teams[0].ConsecutiveWins = Game.GameManager.Teams[0].ConsecutiveWins;
            m_newMatchInfo.Teams[1].ConsecutiveWins = Game.GameManager.Teams[1].ConsecutiveWins;

            m_matchRestartTimer         = new Timer(Engine.GameTime.Source, 200);
            m_matchRestartTimerEvent    = new TimerEvent(m_matchRestartTimer_OnTime);
            m_matchRestartTimer.OnTime += m_matchRestartTimerEvent;
        }
コード例 #4
0
ファイル: GameSession.cs プロジェクト: GDxU/GoalRush
        public MatchSession StartMatch(MatchStartInfo matchInfo)
        {
            MatchSession session = new MatchSession();

            session.MatchInfo = matchInfo;

            CurrentMatchInfo = matchInfo;

            MatchSessions.Add(session);

            return(session);
        }
コード例 #5
0
        private void StartGame()
        {
            if (m_startInfo.NoMenu)
            {
                //Start directly to gameplay
                MatchStartInfo info = new MatchStartInfo();
                info.Arena.Name        = m_startInfo.DefaultArena;
                info.Arena.ColorScheme = new ColorScheme()
                {
                    Color1 = Color.White, Color2 = Color.LightGray
                };
                info.Players[0].InputType  = Gameplay.InputType.Gamepad;
                info.Players[0].InputIndex = PlayerIndex.One;
                info.Players[1].InputType  = Gameplay.InputType.Keyboard;
                info.Players[1].InputIndex = PlayerIndex.Two;
                info.Teams[0].ColorScheme  = new ColorScheme()
                {
                    Color1 = Color.Crimson, Color2 = Color.Orange
                };
                info.Teams[1].ColorScheme = new ColorScheme()
                {
                    Color1 = Color.MediumBlue, Color2 = Color.LightSkyBlue
                };
                info.Teams[0].ConsecutiveWins = 0;
                info.Teams[1].ConsecutiveWins = 0;

                Game.GameSession.CurrentMatchInfo = info;
                Game.GameManager.StartMatch(info);
            }
            else if (m_startInfo.NoLoading)
            {
                //Start to loading screen
                var menuDef = Engine.AssetManager.Get <Menus.MenuDefinition>("Interface/LoadingScreenMenu.lua::Menu");
                Game.MenuManager.StartMenu(menuDef);
            }
            else
            {
                //Start to main menu
                var menuDef = Engine.AssetManager.Get <Menus.MenuDefinition>("Interface/MainMenu.lua::Menu");
                Game.MenuManager.StartMenu(menuDef);
            }
        }
コード例 #6
0
ファイル: GameSession.cs プロジェクト: GDxU/GoalRush
 public GameSession()
 {
     TeamColors       = new Color[2];
     CurrentMatchInfo = new MatchStartInfo();
     MatchSessions    = new List <MatchSession>();
 }