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 ...

Get Mastering LibGDX Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.