diff options
Diffstat (limited to 'td/Assets/Scripts/player.cs')
-rw-r--r-- | td/Assets/Scripts/player.cs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/td/Assets/Scripts/player.cs b/td/Assets/Scripts/player.cs index b972477..4b23054 100644 --- a/td/Assets/Scripts/player.cs +++ b/td/Assets/Scripts/player.cs @@ -4,17 +4,17 @@ using UnityEngine; public class player : MonoBehaviour { + public int initialHealth; public int startingMoney; - GameObject[] towers; - - int playerMoney; - int playerScore; - - bool placingTower; + private GameObject[] towers; + private int playerMoney; + private int playerScore; + private int playerHealth; void Awake() { playerMoney = startingMoney; + playerHealth = initialHealth; } #region stats @@ -22,7 +22,7 @@ public class player : MonoBehaviour { return playerScore; } - public void score(int points) { + public void scoreAdd(int points) { playerScore += points; } @@ -37,6 +37,14 @@ public class player : MonoBehaviour { public void moneySubtract(int sum) { playerMoney -= sum; } + + public int health() { + return playerHealth; + } + + public void decreaseHealth(int hp) { + playerHealth -= hp; + } #endregion public void spawnTower(GameObject towerType) { |