Added multiple game mode selections as well as adding a scene for game mode selection
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user