Add coins score to Game score at the end of gameplay?
Hi Guys,
Basically I was wondering if anyone of you geniuses out here knows how I can add the amount of coins collected at the end of the game to the overall score of the game?
For example, lets say you collected 5coins in my game and your other score in the game for distance travelled is 20, how do I add it up so the overall score when the game is over will be 25 as being the total score?
Thanks in advance. Every little helps
Basically I was wondering if anyone of you geniuses out here knows how I can add the amount of coins collected at the end of the game to the overall score of the game?
For example, lets say you collected 5coins in my game and your other score in the game for distance travelled is 20, how do I add it up so the overall score when the game is over will be 25 as being the total score?
Thanks in advance. Every little helps
Comments
Game.Total Coins = Game.Total Coins + Game.Coins Collected This Game
Replace "Coins Collect This Game" with the attribute you're currently using of course
Game.Total Score = Game.Distance Travelled + Game.Coins Collected
Basically I've done what you've said about adding up my two scores which works perfectly thank you.
However, I would like to know if you know how I can save the two added score together as a high score and then load them again. SO basically for example:
lets say Game.Distance Travelled + Game.coins collected is 1000.
How do I save it as my highscore so i can load em together again when the person plays my game again so the highscore will remain 1000? and also when the person plays the game and beats the highscore of 1000, how do I make sure it changes to that new high score?.
This is what I have now in my score actor in my game:
1. Display text behaviour:
""..floor(game.score + Game.coins)
2. A rule:
Atribute: Game.totalscore > game.score + game.coins
change attribute: Game.totalscore TO game.score + Game.coins
Save attribute: game.totalscore ... Key. Totalscore.
so number 2 is basically where I'm trying to save gamescore + gamecoins which gives me the total score. Then after I wanna save the total score as a highscore. But this isnt working for me so do you have any idea how I can solve this please?
The code/example you've provided looks correct.