September 2013
Beginner to intermediate
388 pages
8h 19m
English
We are now ready to test our Assets class with the rest of the already built game code.
Add the following two imports to CanyonBunnyMain:
import com.badlogic.gdx.assets.AssetManager; import com.packtpub.libgdx.canyonbunny.game.Assets;
After that, we add the calls to load, reload, and unload our assets with the following changes to the code:
@Override
public void create () {
// Set Libgdx log level to DEBUG
Gdx.app.setLogLevel(Application.LOG_DEBUG);
// Load assets
Assets.instance.init(new AssetManager());
// Initialize controller and renderer
worldController = new WorldController();
worldRenderer = new WorldRenderer(worldController);
}
@Override
public void resume () {
Assets.instance.init(new AssetManager()); paused = false; } @Override ...Read now
Unlock full access