We will now create our resource manager. This module will be in charge of creating and storing our decks and assets in general. We’ll retrieve the assets with one single command, and they’ll come from the cache or get created using the definition.
We need to create a file named
resource_manager.lua and add the following line to it:
module ( “ResourceManager”, package.seeall )
This is the same as in the resource definitions; we’re creating a module that will be accessed using
ASSETS_PATH = ‘assets/’
We now create the
ASSETS_PATH constant. This is the path where we will store our assets. You could have many paths for different kinds of assets, but in order to keep things simple, we’ll keep all of them in one single directory ...