Change game theme at runtime

What’s the best way of changing the game theme at runtime? By theme I mean all game art, including GUIs, and sounds.

Would using a collection proxy work, and stuff all the game content in the collection? Then unload and load a new collection when changing theme?

Download size is not an issue (yet), so for now live update is not needed.

Hmm, this really depends. Could have multiple themes in a single atlas and play the appropriate animations to change themes on sprites etc? On GUI you could have multiple textures loaded and change the texture at runtime.

I think the solution will greatly depend on the kind of game you are doing. How many different animations you have. How many atlases. What kind of components.

1 Like

Say this is the content of each theme:

  • Ten sprites with an animation each
  • One tilemap
  • One GUI
  • 100 sounds
  • One background bitmap

Reading the docs, it looks like Tilemap and GUI can be changed at runtime, but not the other components.

I like the idea of separating each theme into its own collection, because each theme then feels self contained. I’m also aware that if the game logic changes, I might have to go through each collection and manually change the structure of them.

Another option is to keep all components separate, and load them with go factories. I’d have to have a way to describe what goes in each theme, probably in a JSON file or similar. Then I could treat each component individually, changing the GUI and Tilemap, and unloading/loading the rest. With the example above, maybe this would work best?