O'Reilly logo

Mastering LibGDX Game Development by Patrick Hoey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required