Skip to content

Commit

Permalink
LevelLock 6/n
Browse files Browse the repository at this point in the history
  • Loading branch information
aadityayadav17 committed Oct 16, 2023
1 parent 9b8a3a6 commit 62dce2c
Showing 1 changed file with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class LevelSelectScreen extends ScreenAdapter {
private static final String INTRO_TEXT = "Select a Planet for Conquest";
private final Stage stage;
private final AnimatedText text;
private BitmapFont font;

private Sprite background;
private final Music music;
Expand All @@ -52,8 +53,7 @@ public class LevelSelectScreen extends ScreenAdapter {
" A lava-filled planet with molten rivers and extreme temperatures."
};

public LevelSelectScreen(GdxGame game) {
BitmapFont font = new BitmapFont();

public LevelSelectScreen(GdxGame game, int currentLevel) {
this.currentLevel = currentLevel;
font = new BitmapFont();
Expand Down Expand Up @@ -172,10 +172,7 @@ private void spawnPlanetBorders() {
descriptionTable.setVisible(true); // Make the description box visible
// Flag for rendering planet borders
boolean isRenderingPlanetBorders = true;
if (isRenderingPlanetBorders) {
Sprite planetBorder = new Sprite(new Texture("planets/planetBorder.png"));
batch.draw(planetBorder, planet[0] - 2.0f, planet[1] - 2.0f, planet[2] + 3.0f, planet[3] + 3.0f);
}

if (Gdx.input.justTouched()) {
if (conventionalPlanetLevel == 0 && highestLevelReached >= -1) { // ICE planet, which is always unlocked initially
loadPlanetLevel(planet);
Expand Down Expand Up @@ -213,16 +210,7 @@ public int mapToConventional(int unconventionalNumber) {
throw new IllegalArgumentException("Invalid planet number");
}
}
int selectedLevel = planet[4];
game.setScreen(new TurretSelectionScreen(game));
dispose();
logger.info("Loading level {}", planet[4]);
GameLevelData.setSelectedLevel(planet[4]);
game.setScreen(new TurretSelectionScreen(game));
}
}
}
}


private String getPlanetDescription(int[] planet) {
int planetIndex = getPlanetIndex(planet);
Expand Down

0 comments on commit 62dce2c

Please sign in to comment.