Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        numPlayers = MainMenu.playerTotal;
        //if(numPlayers == 2) //2 players
        //	playerStatus = new PlayerInfo[minPlayers];
        //else //4 players
        //	playerStatus = new PlayerInfo[maxPlayers];

        //Creating the board and get reference to it's member variables for now
        MainBoard    = new Board(numPlayers);
        playerStatus = MainBoard.playerStatus;
        Debug.Assert(playerStatus != null);
        wallPegStatus = MainBoard.wallPegStatus;
        Debug.Assert(wallPegStatus != null);
        boardStatus = MainBoard.boardStatus;
        Debug.Assert(boardStatus != null);
        accessible = MainBoard.accessible;
        Debug.Assert(accessible != null);

        gmPanel.SetActive(false);
        MessageText.text = "";
        MakeBoard();    // make references to board
        SpawnPlayers(); // make references to players (and Ai's)

        m_StartWait = new WaitForSeconds(startDelay);
        StartCoroutine(GameLoop());
    }
Exemplo n.º 2
0
		public void InitCells( Board board )
		{
			foreach ( Point point in Disabled )
			{
				Cell cell = board.GetCell ( point.X, point.Y );

				if ( cell != null )
				{
					cell.Empty = true;
					cell.gameObject.SetActive ( false );
				}
			}

			foreach ( var g in GoalWindows )
			{
				Cell cell = board.GetCell ( g.pos.X, g.pos.Y );

				if ( cell != null )
				{
					cell.GoalLevel = g.level;
				}
			}
		}
Exemplo n.º 3
0
		public override void Start()
		{
			m_board = GameController.Instance.board;

			m_board.OnCoinDestroy	+= OnCoinDestroy;
			m_board.OnBoardStable	+= OnBoardStable;
			var cinfo = OwnerEntity.GetComponent<CellsInfo>();
			TotalWindows = cinfo.GoalWindows.Count;

			Refresh();
		}