diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-17 22:05:53 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-17 22:05:53 +0200 |
commit | 893160bc3047aa14321943fa52fcd20330d804db (patch) | |
tree | c45502accbbfb75035f7da92dc7c787b462189af /td/Assets/Scripts/player.cs | |
parent | 0aff61a37fa8502521e760a78d8e51b614503773 (diff) | |
download | TD-893160bc3047aa14321943fa52fcd20330d804db.tar.gz TD-893160bc3047aa14321943fa52fcd20330d804db.zip |
Added paycheck-system, player gets payed after wave is finished
Diffstat (limited to 'td/Assets/Scripts/player.cs')
-rw-r--r-- | td/Assets/Scripts/player.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/td/Assets/Scripts/player.cs b/td/Assets/Scripts/player.cs index cb55357..608d09c 100644 --- a/td/Assets/Scripts/player.cs +++ b/td/Assets/Scripts/player.cs @@ -9,6 +9,7 @@ public class Player : MonoBehaviour { private int _gameState; private GameObject[] _towers; private int _playerMoney; + private int _playerPaycheck; private int _playerScore; private int _playerHealth; @@ -41,6 +42,19 @@ public class Player : MonoBehaviour { _playerMoney -= sum; } + public int Paycheck() { + return _playerPaycheck; + } + + public void PaycheckAdd(int sum) { + _playerPaycheck += sum; + } + + public void Payday() { + _playerMoney += _playerPaycheck; + _playerPaycheck = 0; + } + public int Health() { return _playerHealth; } |