summaryrefslogtreecommitdiff
path: root/Assets/Scripts/GameControl.cs
diff options
context:
space:
mode:
authorMarvin Borner2018-05-23 18:13:38 +0200
committerMarvin Borner2018-05-23 18:13:38 +0200
commit36893bdbc54c0923173907007624f8af95495e9a (patch)
treeae32d3e6b101d08f04d15d3f821353d27c0bf0b4 /Assets/Scripts/GameControl.cs
parente847649f0efdeea03da1c473d477a4d55cc253d3 (diff)
Finished column poolHEADv1.0master
Diffstat (limited to 'Assets/Scripts/GameControl.cs')
-rw-r--r--Assets/Scripts/GameControl.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/Assets/Scripts/GameControl.cs b/Assets/Scripts/GameControl.cs
index afd79b7..77f58d7 100644
--- a/Assets/Scripts/GameControl.cs
+++ b/Assets/Scripts/GameControl.cs
@@ -2,14 +2,18 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
+using UnityEngine.UI;
public class GameControl : MonoBehaviour {
public static GameControl instance;
public GameObject gameOverText;
+ public Text scoreText;
public bool gameOver = false;
public float scrollSpeed = -1.5f;
+ private int score = 0;
+
// Use this for initialization
void Awake ()
{
@@ -31,6 +35,16 @@ public class GameControl : MonoBehaviour {
}
}
+ public void BirdScored()
+ {
+ if (gameOver)
+ {
+ return;
+ }
+ score++;
+ scoreText.text = "Score: " + score.ToString();
+ }
+
public void BirdDied()
{
gameOverText.SetActive(true);