Back to project page AndroidShooter.
The source code is released under:
GNU General Public License
If you think the Android project AndroidShooter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package jonathan.geoffroy.shooter.view.screens; /* w ww .j a v a 2 s .c o m*/ import java.util.ArrayList; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.assets.AssetDescriptor; import com.badlogic.gdx.graphics.Texture; import jonathan.geoffroy.shooter.model.Map; import jonathan.geoffroy.shooter.view.utils.App; public class LevelScreen extends GameScreen { private int level; public LevelScreen() { super(); level = 1; loadMap(); } /** * Load the map, using level number * Kill the game if the map can't be load */ private void loadMap() { try { map = Map.load(level); } catch (Exception e) { e.printStackTrace(); Gdx.app.exit(); } } @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public ArrayList<AssetDescriptor<Object>> getAssetDescriptors() { ArrayList<AssetDescriptor<Object>> result = super.getAssetDescriptors(); result.add(new AssetDescriptor(BACKGROUNDS + level + ".jpg", Texture.class)); return result; } @Override public Texture getBackground() { return (Texture) App.getAsset(BACKGROUNDS + level + ".jpg"); } }