// Update is called once per frame void Update() { timeDelay = timeDelay + incrementer; // Increase the time counter by 10 points if (timeDelay == 1000) // If time delay is greater than 1000 { gameInfo.SetActive(false); // Hide the Game info panel level1.pauseOpponent(false); //Activates the opponent LevelsPlayer.pausePlayer(false); // Activate the player timeDelay = 2000.0f; // stop the time delay counter } textUI.text = scores + ""; // Update the score board switch (scores) // check the value variation at each point { case 1: star[0].sprite = sprite; // Set the previous image level to a new image break; case 2: star[1].sprite = sprite; // Set the previous image level to a new image break; case 3: star[2].sprite = sprite; // Set the previous image level to a new image break; } if (showEndBanner) { finishZone.SetActive(true); // Show the finish line tag } }
void Start() { level1.pauseOpponent(true); // pause the opponent movement LevelsPlayer.pausePlayer(true); // pause the player controls showEndBanner = false; // Hide end banner scores = 0; }
// Button to resume game public void resumeGame() { pause_panel.SetActive(false); // Hide the pause panel on the scene LevelsPlayer.pausePlayer(false); // Set player movement to false level1.pauseOpponent(false); // Set opponent movement to false }
public void pauseGame() { pause_panel.SetActive(true); // Display the pause panel on the scene LevelsPlayer.pausePlayer(true); // Set player movement to true level1.pauseOpponent(true); // Set opponent movement to true }
public static void showCompletionBanner() { showEndBanner = true; LevelsPlayer.pausePlayer(true); // Set player movement to true level1.pauseOpponent(true); // Set opponent movement to true }