Exemple #1
0
  public GameScreen(int level) {
    instance = this;

    levelNum = level;

    atlas = new TextureAtlas(Gdx.files.internal("textures/nerdshooter.pack"));

    font = new BitmapFont();

    if (level == -1) {
      GameScreen.useGameDebugRenderer = true;
    } else {
      GameScreen.useGameDebugRenderer = false;
    }

    controlLeft = atlas.findRegion("HUDLeft");
    controlRight = atlas.findRegion("HUDRight");
    controlUp = atlas.findRegion("HUDJump");

    world = new World(level);
    blocks = world.getBlocks(world.getLevel().getWidth(), world.getLevel().getHeight());

    button = new ShapeRenderer();
    batch = new SpriteBatch();

    left = new Rectangle();
    right = new Rectangle();

    jump = new Rectangle();
  }