Exemple #1
0
    void Awake()
    {
        // Making sure there's no existing board
        if (boardHolder != null)
            Destroy (boardHolder);

        // Create a new board and find required scripts
        boardHolder = Instantiate (boardManager);
        boardScript = boardHolder.GetComponent<BoardController>();
        cardSlotScript = slotHolder.GetComponent<CardSlotManager> ();

        // Determine if we're running a tutorial or a multiplayer game. Will eventually require support for multiple game modes
        // --> use switch() and unique game mode managers
        if (tutorial) {
            // Start the tutorial
            tutorialScript = tutorialManager.GetComponent<TutorialController>();
            tutorialScript.StartTutorial();
        }
        else {
            // Starting a new multiplayer game
            boardScript.StartGame ();

            // Update Cardslots to reflect player colours
            cardSlotScript.ChangeSlotColours(PlayerColour.Instance.redSheep);
        }
    }
Exemple #2
0
    void Awake()
    {
        // Making sure there's no existing board
        if (boardHolder != null)
        {
            Destroy(boardHolder);
        }

        // Create a new board and find required scripts
        boardHolder    = Instantiate(boardManager);
        boardScript    = boardHolder.GetComponent <BoardController>();
        cardSlotScript = slotHolder.GetComponent <CardSlotManager> ();

        // Determine if we're running a tutorial or a multiplayer game. Will eventually require support for multiple game modes
        // --> use switch() and unique game mode managers
        if (tutorial)
        {
            // Start the tutorial
            tutorialScript = tutorialManager.GetComponent <TutorialController>();
            tutorialScript.StartTutorial();
        }
        else
        {
            // Starting a new multiplayer game
            boardScript.StartGame();

            // Update Cardslots to reflect player colours
            cardSlotScript.ChangeSlotColours(PlayerColour.Instance.redSheep);
        }
    }
Exemple #3
0
    // Resolve chosen cards, check for game end and prepare for the next turn.
    public IEnumerator ResolutionPhase(GameObject[] displaySheep)
    {
        yield return(StartCoroutine(cardSlotScript.ResolveCards(displaySheep, boardHolder)));

        // Check if the game should end
        if (PlayerColour.Instance.redScore < 1 || PlayerColour.Instance.blueScore < 1)
        {
            EndGame();
            yield break;
        }

        //Change start player for next round
        PlayerColour.Instance.redSheep = !PlayerColour.Instance.redSheep;

        //Change card slots to match new player colours and reset them
        cardSlotScript.ChangeSlotColours(PlayerColour.Instance.redSheep);

        //Move any "waiting" Lasers in to active position
        StartCoroutine(boardScript.updateLasers());
    }