Beispiel #1
0
        //Where the objects will be updated (this means any actions that they can do can actually be done)
        public virtual Level Update(GameTime gT)
        {
            managers.Update(gT, Keyboard.GetState());

            cameras.UpdateStateBefore();

            if (cameras.GetPauser() == null)
            {
                //End game if the game is ended
                if (typeOfGame.Update(managers))
                {
                    return(new ResultsScreen(this, textures, sounds));
                }

                agents.Update();
                projectiles.Update();
                objects.Update();
                paths.Update();
                spawns.Update();
                particles.Update();
                abilities.Update();
                sounds.Update();
                backgrounds.Update();
                statistics.Update(managers);
            }
            else
            {
                if (cameras.GetCameras()[cameras.GetPauserIndex()].GetState().IsButtonDown(Buttons.Back))
                {
                    return(new Menu(textures, sounds));
                }
            }

            cameras.Update(managers);
            cameras.UpdateStateAfter();

            return(this);
        }
        //Where the objects will be updated (this means any actions that they can do can actually be done)
        public virtual Level Update(GameTime gT)
        {
            managers.Update(gT, Keyboard.GetState());

            //End game if the game is ended
            if (typeOfGame.Update(managers))
            {
                return(new ResultsScreen(this));
            }

            agents.Update();
            projectiles.Update();
            objects.Update();
            cameras.Update(managers);
            paths.Update();
            spawns.Update(managers);
            particles.Update();
            abilities.Update();
            sounds.Update(managers);
            backgrounds.Update();
            statistics.Update(managers);
            return(this);
        }