예제 #1
0
        public static void Create(Azul.Game pGame)
        {
            // make sure its the first time
            Debug.Assert(pInstance == null);

            // Do the initialization
            if (pInstance == null)
            {
                pInstance = new GameManager();
            }

            Debug.Assert(pInstance != null);
            pInstance.pGame = pGame;

            PushPlayerScoresToFonts();
        }
예제 #2
0
        private GameManager()
        {
            this.poAttractScreenState = new AttractScreenState();
            this.poSelectScreenState  = new SelectScreenState();
            this.poGamePlayState      = new GamePlayState();
            this.poGamerOverState     = new GameOverState();

            this.poOnePlayerStrategy = new OnePlayerStrategy();
            this.poTwoPlayerStrategy = new TwoPlayerStrategy();

            this.poPlayer1 = new PlayerArtifact(PlayerArtifact.Name.PlayerOne);
            this.poPlayer2 = new PlayerArtifact(PlayerArtifact.Name.PlayerTwo);

            this.pGame      = null;
            this.pGameState = null;
            this.pActiveGameModeStrategy = null;
            this.pActivePlayer           = null;

            this.highScore   = 0;
            this.gameMode    = Mode.OnePlayerMode;
            this.levelUpFlag = false;
        }