Android Open Source - AndroidShooter Level Screen






From Project

Back to project page AndroidShooter.

License

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.

Java Source Code

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");
  }
}




Java Source Code List

jonathan.geoffroy.shooter.MainActivity.java
jonathan.geoffroy.shooter.Main.java
jonathan.geoffroy.shooter.Shooter.java
jonathan.geoffroy.shooter.model.Bullet.java
jonathan.geoffroy.shooter.model.Map.java
jonathan.geoffroy.shooter.model.characters.Character.java
jonathan.geoffroy.shooter.model.characters.Coord2F.java
jonathan.geoffroy.shooter.view.actors.CharacterActor.java
jonathan.geoffroy.shooter.view.actors.JoystickActor.java
jonathan.geoffroy.shooter.view.actors.MapActor.java
jonathan.geoffroy.shooter.view.screens.GameScreen.java
jonathan.geoffroy.shooter.view.screens.LevelScreen.java
jonathan.geoffroy.shooter.view.screens.MainMenuScreen.java
jonathan.geoffroy.shooter.view.utils.App.java
jonathan.geoffroy.shooter.view.utils.HelpScreen.java
jonathan.geoffroy.shooter.view.utils.ListActor.java
jonathan.geoffroy.shooter.view.utils.StageScreen.java
jonathan.geoffroy.shooter.view.utils.TableActor.java
jonathan.geoffroy.shooter.view.utils.WallpaperActor.java