Game Development Reference
In-Depth Information
// Visible game world is 5 meters tall
public static final float VIEWPORT_HEIGHT = 5.0f;
// GUI Width
public static final float VIEWPORT_GUI_WIDTH = 800.0f;
// GUI Height
public static final float VIEWPORT_GUI_HEIGHT = 480.0f;
// Location of description file for texture atlas
public static final String TEXTURE_ATLAS_OBJECTS =
"images/canyonbunny.pack";
// Location of image file for level 01
public static final String LEVEL_01 = "levels/level-01.png";
// Amount of extra lives at level start
public static final int LIVES_START = 3;
}
Now, remove these two lines of code in WorldController :
public Sprite[] testSprites;
public int selectedSprite;
Additionally, remove the following methods from WorldController :
initTestObjects()
updateTestObjects()
moveSelectedSprite()
Remove the following code in the handleDebugInput() method of
WorldController :
// Selected Sprite Controls
float sprMoveSpeed = 5 * deltaTime;
if (Gdx.input.isKeyPressed(Keys.A))
moveSelectedSprite(-sprMoveSpeed, 0);
if (Gdx.input.isKeyPressed(Keys.D))
moveSelectedSprite(sprMoveSpeed, 0);
if (Gdx.input.isKeyPressed(Keys.W))
moveSelectedSprite(0, sprMoveSpeed);
if (Gdx.input.isKeyPressed(Keys.S))
moveSelectedSprite(0, -sprMoveSpeed);
 
Search WWH ::




Custom Search