Added multiple game mode selections as well as adding a scene for game mode selection

This commit is contained in:
Gregory Campbell
2020-05-02 19:02:04 -04:00
parent 6882c368ef
commit af458d9529
17 changed files with 1267 additions and 10 deletions
+35 -2
View File
@@ -80,6 +80,19 @@ public class GMScript : MonoBehaviour
void Start()
{
if(PlayerPrefs.GetInt ("GameMode") == 0 ||
PlayerPrefs.GetInt ("GameMode") == 2)
{
isRandom = false;
} else {
isRandom = true;
}
if(PlayerPrefs.GetInt ("GameMode") == 2)
{
partyHealth = 1;
}
if(isRandom){
// GENERATES PARTY MEMBER COLOURS
@@ -194,6 +207,11 @@ public class GMScript : MonoBehaviour
void Update()
{
if(PlayerPrefs.GetInt ("GameMode") == 3)
{
partyHealth = 100;
}
noRepeat = true;
EnemyHealthText.text = enemyHealth.ToString();
PartyHealthText.text = partyHealth.ToString();
@@ -256,9 +274,10 @@ public class GMScript : MonoBehaviour
gameover = true;
GameOver.SetActive(true);
cursorLock = false;
StartCoroutine(EndGameDisplay(GameOver));
}
if(enemyHealth <= 0 || victory == true)
@@ -273,9 +292,10 @@ public class GMScript : MonoBehaviour
victory = false;
gameover = true;
Victory.SetActive(true);
cursorLock = false;
StartCoroutine(EndGameDisplay(Victory));
}
if (Input.GetMouseButtonDown(0))
@@ -965,6 +985,19 @@ public class GMScript : MonoBehaviour
cursorLock = false;
}
IEnumerator EndGameDisplay(GameObject display)
{
display.SetActive(true);
yield return new WaitForSeconds(5);
display.SetActive(false);
SceneManager.LoadScene("Mode Select Scene");
}
void EnemyBuilder()
{