Entry Scene added; Negative score fix
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class Quiz2Controller : MonoBehaviour {
|
||||
|
||||
@@ -129,7 +130,7 @@ public class Quiz2Controller : MonoBehaviour {
|
||||
|
||||
// TODO: Game over
|
||||
if (counterValue > totalGameTime)
|
||||
Debug.Log("Game over!");
|
||||
SceneManager.LoadScene("EntryScene");
|
||||
counterValue += Time.deltaTime;
|
||||
|
||||
UpdateCounter();
|
||||
@@ -197,9 +198,14 @@ public class Quiz2Controller : MonoBehaviour {
|
||||
void LoadNextPair()
|
||||
{
|
||||
scoreValue += GetScore();
|
||||
if (scoreValue < 0)
|
||||
scoreValue = 0;
|
||||
UpdateScore();
|
||||
questionIdx = (questionIdx + 1) % questions.Count;
|
||||
UpdateScene();
|
||||
questionIdx = questionIdx + 1;
|
||||
if (questionIdx == questions.Count)
|
||||
SceneManager.LoadScene("EntryScene");
|
||||
else
|
||||
UpdateScene();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user