O'Reilly logo

Developing Mobile Games with Moai SDK by Francisco Tufro

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

Exercises

Putting this together should be something you can achieve now. So, take the source code of the main.lua file we created previously and modify it in order to make use of our ResourceManager and ResourceDefinitions entities. You’ll need to include resource_definition.lua and resource_manager.lua in main.lua and then make good use of them. If you download the source code for this chapter from the website, main.lua has already been modified to work with ResourceManager.

Another exercise is to code a way to unload assets from ResourceManager. This has also been done in the code for this chapter, which you can download from the website.

Note

The unload method is pretty important since it will be needed in order to actually free the memory reserved ...

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