Game Development Reference
In-Depth Information
Implementing the CanyonBunnyMain class
The following listing shows the first implementation of CanyonBunnyMain :
package com.packtpub.libgdx.canyonbunny;
import com.badlogic.gdx.ApplicationListener;
import com.packtpub.libgdx.canyonbunny.game.WorldController;
import com.packtpub.libgdx.canyonbunny.game.WorldRenderer;
public class CanyonBunnyMain implements ApplicationListener {
private static final String TAG =
CanyonBunnyMain.class.getName();
private WorldController worldController;
private WorldRenderer worldRenderer;
@Override public void create () { }
@Override public void render () { }
@Override public void resize (int width, int height) { }
@Override public void pause () { }
@Override public void resume () { }
@Override public void dispose () { }
}
This class implements ApplicationListener to become one of LibGDX's
starter classes.
A reference each to WorldController and WorldRenderer enables this class to
update and control the game's flow and also to render the game's current state to
the screen.
There is a TAG variable that holds a unique label derived from the class's name. It will
be used for any logging purposes. LibGDX's built-in logging facility requires you to
pass in a so-called tag name for every message to be logged. So, to stay consistent in
our code, we will simply add a tag variable to each class.
 
Search WWH ::




Custom Search