How can I get the score to not reset (back to 0) when going to the next level?
Dar
Member Posts: 37
I set up a score system, how can I set it so that when I continue to the next level it doesn't reset back to 0? So for example, lets say I score 100 points on the 1st level and I completed it, so I go onto the next level, but the score is back to 0. How can I make it remember the score?
And I how can I set it so it remembers the highest score that that person has ever done? So for example, Let say the player gets 300 (his highest score so far) on the 2nd level then exits the game (I want my game to automatically save his score). Then the next time he plays it he sees his highest score (300) and then when he get higher than that, the 300 automatically erases and is replaced with his new high score. How can I do this?
Thanks guys!
And I how can I set it so it remembers the highest score that that person has ever done? So for example, Let say the player gets 300 (his highest score so far) on the 2nd level then exits the game (I want my game to automatically save his score). Then the next time he plays it he sees his highest score (300) and then when he get higher than that, the 300 automatically erases and is replaced with his new high score. How can I do this?
Thanks guys!
Comments
But hopefully someone gives a better answer because I'm stuck as well
And do you have different scenes for each level?
As to the highscore, in your game over/complete scene have a rule like this;
(Be sure to create two integers first; one called score, one called highscore.)
Rule
If game.score > game.highscore
Change game.highscore to game.score
(use save attribute)
Save game.highscore as XXX (XXX would usually be "highscore")
Then on your main screen, or wherever you want the high score to show up, you do;
Load attribute - highscore
Then do something like "display text: "game.highscore".
Hope that helps.
When actor ovelaps or collides with .....
Change attribute: game.Game score to (copy and paste then +20) game.Game score +20.
So every time it adds 20 to the score.
Ok I will try what peachpellen said and let you know thank you!
Thanks
When atrritute game.score < infinti (so less than anything)
Save attribute.
But I still need to figure out how to set it back to 0 when the "you lose" or "you win" scene comes up.
Any ideas?
If you want to display the final score or something on the 'you win/lose' scene you could have buttons like 'retry' 'next level' or 'menu' and just put a rule on each of them that when touched change attribute game.score to 0.