January 2015
Beginner to intermediate
478 pages
9h 46m
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 this, modify the init() and render() methods:
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