Exemple #1
0
        void InitializeGame()
        {
            var sceneParameters = GameBoardSceneParameters.GetParameters();

            // If null, start with a default board for testing when directly starting from GameBoard scene.
            if (sceneParameters == null)
            {
                sceneParameters = new GameBoardSceneParameters()
                {
                    GameBoard = GameBoardGenerator.CreateTriangleGame(4),
                    TimeLimit = 180f
                };
            }

            if (sceneParameters.IsReplay)
            {
                replayManager.InitializeWithReplay(sceneParameters.ReplayHistory);
                BuildBoardView(replayManager.GameBoard);
            }
            else
            {
                gameController.InitializeWithBoard(sceneParameters.GameBoard, sceneParameters.TimeLimit);
                BuildBoardView(gameController.GameBoard);
            }
        }
Exemple #2
0
 public void PlayHardGame()
 {
     GameBoardSceneParameters.SetParameters(new GameBoardSceneParameters()
     {
         GameBoard = GameBoardGenerator.CreateTriangleGame(6),
         TimeLimit = (60f * 3f), // 3 minutes
     });
     SceneManager.LoadScene("GameBoard");
 }