I am building a game based on libGdx and I want to be able to check for and download updated assets at some point before the player starts playing. The game is being built for PC and for Android.

I haven't been able to find much on downloading assets. It seems libGdx assumes all assets will be packaged with the game or already on "external" storage and available for the AssetManager.

So far, the best option I've found is setting up updating code prior to starting the libGdx application.

How can I have my assets download while the libGdx application is running? Possibly to allow some interaction while waiting, or progressive asset downloads allowing limited game play. My goal is to allow for dynamic updates to assets, and to allow users to get into the game quicker. Especially new players, I don't want them waiting on a download screen before they see anything of the actual game.

  • \$\begingroup\$ code.google.com/p/libgdx/wiki/AssetManager suggests it can do what you want. Most notably you can manually unload assets, and write your own loaders / resolvers if need be. \$\endgroup\$ – Adam May 23 '13 at 0:15

As Adam suggested, you can write your own custom loader which could implement a network connection to any type of server which could download assets during runtime and serve them up.

Just implement the file loading interface it provides and request a url as a string for the asset name in the overriden load function and pass that to your downloader. Then you can simply make regular load function calls throughout your code.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.