Banking System
jacobsond
Member Posts: 3
I'm curious as to how I would go about generating a numerical counter that would reflect the amount of coins or money a player has.
Hypothetical:
A tower defence game where the player on a particular level starts with 100 coins.
Towers cost say 50.
Once you have purchased two towers you cannot build anymore towers.
When an enemy is destroyed there would be a rule to generate say 20 coins and this would grow.
My question is, how do i insert an actor that is a money counter that will grow or diminish based on the users actions?
Even if this may not be possible, any response would be greatly appreciated.
Hypothetical:
A tower defence game where the player on a particular level starts with 100 coins.
Towers cost say 50.
Once you have purchased two towers you cannot build anymore towers.
When an enemy is destroyed there would be a rule to generate say 20 coins and this would grow.
My question is, how do i insert an actor that is a money counter that will grow or diminish based on the users actions?
Even if this may not be possible, any response would be greatly appreciated.
Comments
Tables is the answer.
You can write your data to tables and save data and retrieve data and it all gets remembered. Attributes do not do that - so learn about tables.
Cheers
Create an 'Integer Attribute' called CoinStack.
Then in One of the actors you'll add an expression 'Change Attribute' and say,
When you add coins you say 'CoinStack = CoinStack + X'
When you minus coins you say 'CoinStack = CoinStack - X'
where X will be the value that you add or subtract.
As easy as that.
Best of luck buddy.
and if you want to see how much money you have while playing just place an actor and display the text of game.CoinStack
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮