Bandidos
|
Public Member Functions | |
ScoreSystem () | |
int | addScore (int score) |
int | subScore (int score) |
int | getMultiplier () |
void | setMultiplier (int value) |
int | getScore () |
int | getBestScore () |
int | getBestMultiplier () |
void | endScoreSession (boolean saveIfBest) |
boolean | isBestSession () |
void | resetBestData () |
void | loadBestData () |
void | saveBestData () |
This a class which can be used to track score and save / load highscore data.
com.mygdx.game.score.ScoreSystem.ScoreSystem | ( | ) |
Instantiates the ScoreSystem, loads the last best score data and starts a new score session
int com.mygdx.game.score.ScoreSystem.addScore | ( | int | score | ) |
Adds Score to the current score session. If the current score reaches higher than the best score, it becomes the best score (Not saved)
score | to add * the current multiplier to the current score. |
void com.mygdx.game.score.ScoreSystem.endScoreSession | ( | boolean | saveIfBest | ) |
Ends the current score session and resets all current score values.
saveIfBest | saves the best score data into the device if it was reached by this session |
int com.mygdx.game.score.ScoreSystem.getBestMultiplier | ( | ) |
Gets the best multiplier session If the current multiplier > than the saved best multiplier, it becomes the new one and thus is returned by this method
int com.mygdx.game.score.ScoreSystem.getBestScore | ( | ) |
Gets the best score session. If the current score > than the saved best score, it becomes the new one and thus is returned by this method
int com.mygdx.game.score.ScoreSystem.getMultiplier | ( | ) |
Gets the value of the current score multiplier.
int com.mygdx.game.score.ScoreSystem.getScore | ( | ) |
Gets the current score.
boolean com.mygdx.game.score.ScoreSystem.isBestSession | ( | ) |
void com.mygdx.game.score.ScoreSystem.loadBestData | ( | ) |
Loads the best score and multiplier data into the current session from the current device.
void com.mygdx.game.score.ScoreSystem.resetBestData | ( | ) |
Resets the device saved data. Call the 'loadBestData' to reset the data loaded before calling this method also.
void com.mygdx.game.score.ScoreSystem.saveBestData | ( | ) |
Saves the current BestScore and BestMultiplier data into the current device.
void com.mygdx.game.score.ScoreSystem.setMultiplier | ( | int | value | ) |
Sets the value of the current score multiplier If the current multiplier > than the saved best multiplier, it becomes the new best multiplier
value | to set the current multiplier to. |
int com.mygdx.game.score.ScoreSystem.subScore | ( | int | score | ) |
Subtract the given score value from the current score.
score | to subtract * the current multiplier from the current score. |