示例#1
0
        public void UpdateSelection(GameTime gameTime)
        {
            if (readyToLoadMatch)
            {
                LoadMatch();
                readyToLoadMatch = false;
                screen           = Screen.Match;

                SoundsLibrary.PlaySongs(SoundsLibrary.matchLittleYellowSong);
            }
            else
            {
                GetAllInputs();

                foreach (Selection s in selections)
                {
                    s.Update(gameTime);

                    if (s.selectionKind == Selection.SelectionKind.InputSelection)
                    {
                        CheckForSelectedInput(s);
                    }
                }

                if (numberOfPlayersSelected == maxNumberOfPlayers && maxNumberOfPlayers > 1)
                {
                    readyToLoadMatch = true;
                }
            }
        }
示例#2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            SoundsLibrary.LoadSoundLibrary(Content);

            LoadFonts();

            LoadMenu();

            LoadSelectionScreen();

            SoundsLibrary.PlaySongs(SoundsLibrary.menuSong);
        }
示例#3
0
        public void ClearMatch()
        {
            background = Content.Load <Texture2D>("Graphics/boy_underneath_a_tree");

            players.Clear();
            tiles.Clear();
            result                  = null;
            maxNumberOfPlayers      = 0;
            numberOfPlayersSelected = 0;
            deadPlayers             = 0;
            ResetInputsTaken();

            selections.Clear();
            LoadSelectionScreen();

            screen = Screen.Menu;

            SoundsLibrary.PlaySongs(SoundsLibrary.menuSong);
        }
示例#4
0
        public void UpdateMatchStatistics(GameTime gameTime)
        {
            bool reloadMatch = false;

            foreach (Player p in players)
            {
                p.inputs.GetInputs();

                if (p.inputs.PauseGame())
                {
                    if (!Result.matchEnded)
                    {
                        reloadMatch = true;
                    }
                    else
                    {
                        screen = Screen.Result;

                        SoundsLibrary.PlaySongs(SoundsLibrary.victoryScreenSong);
                    }
                }
            }

            if (reloadMatch)
            {
                foreach (Player pl in players)
                {
                    pl.ResetPlayer();
                }

                deadPlayers = 0;
                screen      = Screen.Match;
            }

            result.Update(gameTime);
        }