- create a struct to represent data you want to save: level name, time elapsed, points scored, etc.
- count time for for the current level in the Game Mode as you do
- in the Game Instance (that persists throughout the game session) have a Map (a much cooler cousin of the humble array) variable
Name | Struct
- when the level is over and better score has been achieved, make a struct, send it to the Game Instance and have it add it to the map (or an array)
- when the new level is loaded, you can access the Game Instance, read the content of the map / array and create the appropriate UI using widgets
Eventually you’ll need a save game system if you want the date to persist between game sessions as well. You can use the very same map / array in the Save Game object.