Save high score - time

Hi everyone,



is it possible to save the used time of the player into a high score table?



My Game is in a InGameState! Now I thought about creating a new GameState and name it HighScoreGameState! When the player drives over the finish line the InGameState gets deattached and the HighScoreGameState gets attached! This works so far!



But how can I give the time from the InGameState to the HighScoreGameState???



I hope this wasn't confusing :wink:



Thanks for any help,

RapidM

Create a method in the HighscoreGameState?



aka



HighscoreGameState.SetGameResults(int time,int score)

And if you want to save the highscore to fileystem, then you can serialize that HighScoreGameState and deserialize when new game starts.