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

Chapter 6. Resource Manager

If we start developing our game, we’ll eventually need to create an entity that handles all of our assets. We’ll call it ResourceManager. We’ll see how to create one that allows you to add images, fonts, and sounds to your games.

The main idea behind the resource manager is to cache assets that we’ll use more than once and to have a centralized and abstracted way to create assets.

Resource definitions

In order to be able to define resources, we need to create a module that will be in charge of handling this. The main idea is that before calling a certain asset through ResourceManager, it has to be defined in ResourceDefinitions. In this way, ResourceManager will always have access to some metadata it needs to create the ...

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