Entry Scene added; Negative score fix

This commit is contained in:
Mediha Zukic
2017-05-20 18:29:26 +03:00
parent e3875c8248
commit 167c7032ec
29 changed files with 3426 additions and 14 deletions

View File

@@ -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>