Save and load game profiles
There are many different ways to implement the save/restore functionality in a game. There is a spectrum of options in the solution space, with one end of the spectrum for a minimalist approach for save/restore philosophy, specifically a simple name/value pair approach, with values for persisting a high score or the current level number. LibGDX supports this natively through the Preferences class in LibGDX that is modeled after preferences on Android. The other end of the save/restore functionality spectrum is a brute force approach where everything in-memory for the current game state is dumped to some binary format. This approach has severe drawbacks with save game sizes and also has a brittle state where one change ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access