September 2013
Beginner to intermediate
388 pages
8h 19m
English
Now that we have implemented all the game objects of Canyon Bunny, we can complete the level loader.
First, add the following import lines to Level:
import com.packtpub.libgdx.canyonbunny.game.objects.BunnyHead; import com.packtpub.libgdx.canyonbunny.game.objects.Feather; import com.packtpub.libgdx.canyonbunny.game.objects.GoldCoin;
Additionally, add these three member variables to the same class:
public BunnyHead bunnyHead; public Array<GoldCoin> goldcoins; public Array<Feather> feathers;
After that, modify the two methods init() and render() as follows:
private void init (String filename) {
// player character
bunnyHead = null;
// objects
rocks = new Array<Rock>();
goldcoins = new Array<GoldCoin>();
feathers = new Array<Feather>(); ...Read now
Unlock full access