Esempio n. 1
0
 void Start()
 {
     gameIsPlaying = false;
     activeScenario = scenarios[currentScenarioIndex].Begin();
     scenarioVar.text = (1 + currentScenarioIndex).ToString();
     playerHealthVar.text = startingPlayerHealth.ToString();
 }
Esempio n. 2
0
 // métodos padrões
 void Awake()
 {
     playerHealth = startingPlayerHealth;
     board.Initialize(boardSize, tileContentFactory);
     board.ShowGrid = true;
     activeScenario = scenario.Begin();
 }
Esempio n. 3
0
 void BeginNewGame()
 {
     playerHealth = startingPlayerHealth;
     enemies.Clear();
     nonEnemies.Clear();
     board.Clear();
     activeScenario = scenario.Begin();
 }
Esempio n. 4
0
 //---------------------------------------------------------------
 //Functions
 void Awake()
 {
     playerHealth = startingPlayerHealth;
     boardSize    = new Vector2Int((int)gameBoardGround.transform.localScale.x, (int)gameBoardGround.transform.localScale.y);
     board.Initialize(boardSize, tileContentFactory);
     board.ShowGrid = true;
     activeScenario = scenario.Begin();
 }
Esempio n. 5
0
 public void NextScenario()
 {
     currentScenarioIndex++;
     if (currentScenarioIndex >= scenarios.Length)
     {
         currentScenarioIndex = 0;
     }
     activeScenario = scenarios[currentScenarioIndex].Begin();
     scenarioVar.text = (1 + currentScenarioIndex).ToString();
 }
Esempio n. 6
0
 public void BeginNewGame()
 {
     defeatCoroutineIsExecuted = false;
     currentScenarioIndex = 0;
     playerHealth = startingPlayerHealth;
     ChangeButtonText("Start Next Round");
     interactableButton.interactable = false;
     gameIsPlaying = true;
     ResetBoard();
     activeScenario = scenarios[currentScenarioIndex].Begin();
 }
Esempio n. 7
0
    void chooseTower(GameTile tile)
    {
        newTowers.Remove(tile);
        if (!scenarioIsInProgress)
        {
            activeScenario       = scenario.Begin();
            scenarioIsInProgress = true;
        }
        else
        {
            activeScenario.NextWave();
        }

        isBuildPhase = false;
        // for(var i = 0; i < TargetPoint.BufferedCount; i++) {
        //  TargetPoint t = TargetPoint.GetBuffered(i);
        // }
        foreach (GameTile t in newTowers)
        {
            board.ToggleWall(t);
        }

        newTowers.Clear();
    }