From 893160bc3047aa14321943fa52fcd20330d804db Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Tue, 17 Oct 2017 22:05:53 +0200 Subject: Added paycheck-system, player gets payed after wave is finished --- td/Assets/Scripts/player.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'td/Assets/Scripts/player.cs') 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; } -- cgit v1.2.3