Scoring- Am I doing this right?
NesesitaGames
Member Posts: 160
My head's about to explode! What I'm trying to keep track of and show on a High Scores page is the following: A Total Game Score, as well as Top Scores for each Level.
Here's what I have so far..
Title Scene:
Load game.total_game_score to TOTAL_GAME_SCORE (key)
Gameplay Scene 1:
At the end of scene, Change game.total_game_score to game.total_game_score+game.game_score_1
and Save total_game_score to TOTAL_GAME_SCORE (key)
Also, rule: If self.top_score is equal to or less than game.game_score_1 then Constrain self.top_score to game.game_score_1 and save self.top_score as GAME_SCORE_1
Results Scene:
If game.game_score_1 is greater than or equal to 10,000, then unlock Gameplay Scene 2.
If game.game_score_1 is less than 10,000 then Change game.total_game_score to game.total_game_score-game.game_score_1 and retry
Gameplay Scene 2 is pretty much like Gameplay Scene 1, only with game.game_score_2
High Scores Scene:
Load and Display TOTAL_GAME_SCORE as total_game_score
Load and Display GAME_SCORE_1 as game_score_1
etc.
Please help, anyone? Is my logic just completely out the window here?
Here's what I have so far..
Title Scene:
Load game.total_game_score to TOTAL_GAME_SCORE (key)
Gameplay Scene 1:
At the end of scene, Change game.total_game_score to game.total_game_score+game.game_score_1
and Save total_game_score to TOTAL_GAME_SCORE (key)
Also, rule: If self.top_score is equal to or less than game.game_score_1 then Constrain self.top_score to game.game_score_1 and save self.top_score as GAME_SCORE_1
Results Scene:
If game.game_score_1 is greater than or equal to 10,000, then unlock Gameplay Scene 2.
If game.game_score_1 is less than 10,000 then Change game.total_game_score to game.total_game_score-game.game_score_1 and retry
Gameplay Scene 2 is pretty much like Gameplay Scene 1, only with game.game_score_2
High Scores Scene:
Load and Display TOTAL_GAME_SCORE as total_game_score
Load and Display GAME_SCORE_1 as game_score_1
etc.
Please help, anyone? Is my logic just completely out the window here?
Comments
Well call our rule "score" and we'll use mario coins for example. Score is an integer. Our highscore board integer will be called "highscore"
When "mario" touches/ overlaps "coin" --> change attribute "score" to "score +1"
If "score" is > highscore --> change attribute "score" to "highscore", save attribute "highscore"
At the begining of your game "load attribute" "highscore"
Use this method for your levels, change score to a different name for each level but refer to a singular highscore. This is just a super quick example.
So maybe I should be setting up highscore attributes (TopScore1, TopScore2, etc) for each level as well? So like this:
Where game.game_score_1 is the level score
TopScore1 is the top score of level1, and
total_game_score is the sum of all level scores
At the end of Scene1, Rule:
If game.game_score_1 is greater than or equal to game.TopScore1
then Constrain game.TopScore1 to game.game_score_1
then Change game.top_game_score to game.top_game_score +game.TopScore1
then on my HighScores screen I can do:
Total Game Score: Display game.total_game_score
Top Score for Level 1: Display game.TopScore1
What do you think?
Really appreciate the help.
Have integers:
scorelv1
scorelv2
scorelv3
...etc for each respective level
highscore1 (scoreboard for level 1)
highscore2 (scoreboard for level 2)
highscore2 (scoreboard for level 3)
etc...
Use "scorelv1" for level 1, when you want to add to the score do change attribute "scorelv1 + 1" (+1 being a default value, you can use any interval of number like +10) if at the end of the level you want to display the score for level 1, then show the attribute "scorelv1" (in whichever display method you use for showing text) since all the points gained in level 1 will be totaled in "scorelv1".
Now in the same rule for the scorekeeper that tallies the points for "scorelv1" add a rule where if "scorelv1" is greater than (>) "highscore1" then change attribute "scorelv1" to "highscore1", this will take the values of scorelv1 and add it to "highscore1" and whichever display method you use will show the top score.
Be sure to set the default values of all the "highscores" to 0 or else it won't know if it is greater or less since there are no existing scores.
Repeat the method if you want to have extra values on the scoreboard. Do this for every stage with the respective integers.
If you want to do a total grand score of all the levels combined, simple:
"scorelv1 + scorelv2 + scorelv3 + etc..." this will summarize the total of all scores.
Hope this clears some things up
Much appreciated,
Lorraine