September 2013
Beginner to intermediate
388 pages
8h 19m
English
We will now implement the level loader that will be able to read and interpret the image data.
You might want to check the handling of level data in Chapter 3, Configuring the Game, where we defined and discussed the level format.
Create a new file for the Level class and add the following code:
package com.packtpub.libgdx.canyonbunny.game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.utils.Array; import com.packtpub.libgdx.canyonbunny.game.objects.AbstractGameObject; import com.packtpub.libgdx.canyonbunny.game.objects.Clouds; import com.packtpub.libgdx.canyonbunny.game.objects.Mountains; import com.packtpub.libgdx.canyonbunny.game.objects.Rock; ...
Read now
Unlock full access