Ejemplo n.º 1
0
        public override void ReinitializeLevel(GameManager pGameManager)
        {
            SoundManager.StopAllSounds();

            TimerManager.PurgeAllNodes();
            GameObjectManager.PurgeAllNodes();
            SpriteBatch pSBatch = SpriteBatchManager.Find(SpriteBatch.Name.Boxes);

            pSBatch.GetSBNodeManager().PurgeAllNodes();
            pSBatch = SpriteBatchManager.Find(SpriteBatch.Name.Sprites);
            pSBatch.GetSBNodeManager().PurgeAllNodes();
            ColPairManager.PurgeAllNodes();
            DelayedObjectManager.PurgeAll();

            if (pGameManager.pActivePlayer.name == PlayerArtifact.Name.PlayerOne)
            {
                PlayerOneInit(pGameManager);
                pGameManager.poPlayer1.RestoreManagerStates(pGameManager.pGame.GetTime());
                pGameManager.SetActivePlayer(PlayerArtifact.Name.PlayerOne);
            }
            else
            {
                PlayerTwoInit(pGameManager);
                pGameManager.poPlayer2.RestoreManagerStates(pGameManager.pGame.GetTime());
                pGameManager.SetActivePlayer(PlayerArtifact.Name.PlayerTwo);
            }
        }
Ejemplo n.º 2
0
        // Should be called at some point before leaving state
        public override void CleanUp(GameManager pGameManager)
        {
            GameManager.PushHighScoreToFont();

            ShipManager.Purge();

            TimerManager.PurgeAllNodes();
            GameObjectManager.PurgeAllNodes();

            SpriteBatch pSBatch = SpriteBatchManager.Find(SpriteBatch.Name.Boxes);

            pSBatch.GetSBNodeManager().PurgeAllNodes();
            pSBatch = SpriteBatchManager.Find(SpriteBatch.Name.Sprites);
            pSBatch.GetSBNodeManager().PurgeAllNodes();

            ColPairManager.PurgeAllNodes();

            DelayedObjectManager.PurgeAll();

            InputSubject pInputSubject = InputManager.GetArrowLeftSubject();

            pInputSubject.PurgeAll();

            pInputSubject = InputManager.GetArrowRightSubject();
            pInputSubject.PurgeAll();

            pInputSubject = InputManager.GetSpaceSubject();
            pInputSubject.PurgeAll();


            Handle(pGameManager);
        }