Esempio n. 1
0
    // wipe words left on screen, destroy their game objects
    // wait 3 seconds to allow breathing room, then reset the game
    private IEnumerator Reset()
    {
        foreach (Word word in words)
        {
            word.ClearWord();
        }
        words.Clear();
        yield return(new WaitForSeconds(3f));

        scoreManager.ResetScore();
        timeKeeper.ResetTime();
        gameOver = false;
    }
Esempio n. 2
0
    private void StartNewLevel(int level)
    {
        IsLevelCleared = false;

        onStartLevel?.Invoke();
        onStartCountdown?.Invoke();

        UpdatePlayerLevel(level);
        m_timeKeeper.ResetTime();

        SpawnEntities();
        PlaceCoinsAndPowerups();
        m_startVillainsCoroutine = StartCoroutine(StartVillains());

        // Start level timer
        m_timeKeeper.StartTime(3.0f);
    }
Esempio n. 3
0
    public void GiveTurn(string method)
    {
        if (!TutorialGuide.tutorialMode)
        {
            Dictionary <string, string> strData = new Dictionary <string, string>()
            {
                { "character", character },
                { "method", method }
            };
            webSocketManager.Send("yourTurn", strData, null);
            movesRemaining   = character == "Human"?leadersMovesPerTurn : followersMovesPerTurn;
            moveDisplay.text = "Moves: Waiting for partner!";

            turnsLeft -= 1;
            totalTurnsDisplay.text  = "Turns Left: " + (turnsLeft + 1) / 2; // Shows each player's usable turns
            totalTurnsDisplay.color = Color.black;

            if (character == "Human")
            {
                instructionControl.TurnOff();
                endTurnButton.interactable = false;
            }
            else
            {
                // Make the finish command button non-interactable.
                finishCommandButton.interactable = false;
            }


            myTurn = false;
            myHandler.GiveTurn();
            backgroundImage.material.SetColor("_Color", gamePink);
            backgroundImage.material.SetColor("_Color2", gamePink);
            timeKeeper.ResetTime(character == "Human"?"Agent":"Human");
            if (isFirstTurn)
            {
                isFirstTurn = false;
            }
        }
        else
        {
            if (character == "Agent")
            {
                movesRemaining = followersMovesPerTurn;
                timeKeeper.ResetTime("Agent");
            }
            else
            {
                timeKeeper.ResetTime("Human");
            }
        }
    }