Asset Manager

Asset Manager

The Asset Manager loads text files from your assets folder, like levels and tilemaps. Images don't need the Asset Manager, since the Draw Module loads them on its own.

Files load in the background, so start loading them before the game starts, and wait for doneLoading() before using them.

MDog.AssetManager.loadFile("levels/level1.csv", "level1");

function main() {
    if (!MDog.AssetManager.doneLoading()) {
        return;
    }
    const level = MDog.AssetManager.get("level1");
    ...
}

The Asset Manager can be accessed with MDog.AssetManager.method().

Asset Manager Methods