Commit bc6d1731 authored by Aneta Steimarova's avatar Aneta Steimarova

#962 Added background for easy and hard difficulty

parent 9f027a91
...@@ -212,10 +212,10 @@ public class SafeGame extends AbstractTablexiaGame<Void> { ...@@ -212,10 +212,10 @@ public class SafeGame extends AbstractTablexiaGame<Void> {
backgroundGroup.setDebug(true); backgroundGroup.setDebug(true);
getStage().addActor(backgroundGroup); getStage().addActor(backgroundGroup);
if(getGameDifficulty()!=GameDifficulty.BONUS)safeBackground = new Image(getScreenTextureRegion(SafeAssets.SAFE_BACKGROUND)); safeBackground = getBackgroudForDifficulty(getGameDifficulty());
else safeBackground = new Image(getScreenTextureRegion(SafeAssets.BONUS_BACKGROUND));
safeBackground.setPosition(getViewportLeftX(), getSceneOuterBottomY()); safeBackground.setPosition(getViewportLeftX(), getSceneOuterBottomY());
safeBackground.setSize(getViewportWidth(), getSceneOuterHeight()); if(getGameDifficulty()!=GameDifficulty.BONUS)safeBackground.setSize(getViewportWidth() - getViewportWidth() * SIDEBAR_RELATIVE_WIDTH, getSceneOuterHeight());
else safeBackground.setSize(getViewportWidth(), getSceneOuterHeight());
backgroundGroup.addActor(safeBackground); backgroundGroup.addActor(safeBackground);
sideBar = new Image(getScreenTextureRegion(SafeAssets.SIDE_BAR)); sideBar = new Image(getScreenTextureRegion(SafeAssets.SIDE_BAR));
...@@ -238,6 +238,15 @@ public class SafeGame extends AbstractTablexiaGame<Void> { ...@@ -238,6 +238,15 @@ public class SafeGame extends AbstractTablexiaGame<Void> {
addScore(); addScore();
} }
private Image getBackgroudForDifficulty(GameDifficulty gameDifficulty) {
switch (gameDifficulty){
case EASY: return new Image(getScreenTextureRegion(SafeAssets.EASY_BACKGROUND));
case HARD: return new Image(getScreenTextureRegion(SafeAssets.HARD_BACKGROUND));
case BONUS: return new Image(getScreenTextureRegion(SafeAssets.BONUS_BACKGROUND));
default: return new Image(getScreenTextureRegion(SafeAssets.SAFE_BACKGROUND));
}
}
private void addScore() { private void addScore() {
scoreTextLabel = new TablexiaLabel(getFormattedText(SafeAssets.SCORE_TEXT, score, MAX_SCORE), new TablexiaLabel.TablexiaLabelStyle(ApplicationFontManager.FontType.BOLD_18, Color.BLACK)); scoreTextLabel = new TablexiaLabel(getFormattedText(SafeAssets.SCORE_TEXT, score, MAX_SCORE), new TablexiaLabel.TablexiaLabelStyle(ApplicationFontManager.FontType.BOLD_18, Color.BLACK));
scoreTextLabel.setPosition(getViewportWidth() - SCORE_OFFSET_X - scoreTextLabel.getWidth() - ((BUTTON_WIDTH - scoreTextLabel.getWidth()) / 2), getSceneInnerBottomY() + SCORE_OFFSET_Y); scoreTextLabel.setPosition(getViewportWidth() - SCORE_OFFSET_X - scoreTextLabel.getWidth() - ((BUTTON_WIDTH - scoreTextLabel.getWidth()) / 2), getSceneInnerBottomY() + SCORE_OFFSET_Y);
......
...@@ -52,6 +52,7 @@ public class SafeAssets { ...@@ -52,6 +52,7 @@ public class SafeAssets {
//======== SAFE EASY ============= //======== SAFE EASY =============
public static final String CIRCLE = GFX_PATH + EASY + "circle"; public static final String CIRCLE = GFX_PATH + EASY + "circle";
public static final String CIRCLE_BACKGROUND = GFX_PATH + EASY + "circle_background"; public static final String CIRCLE_BACKGROUND = GFX_PATH + EASY + "circle_background";
public static final String EASY_BACKGROUND = GFX_PATH + EASY + "background";
public static final String LIGHT1_RED = GFX_PATH + EASY + LIGHTS + "light1_red"; public static final String LIGHT1_RED = GFX_PATH + EASY + LIGHTS + "light1_red";
public static final String LIGHT1_GREEN = GFX_PATH + EASY + LIGHTS + "light1_green"; public static final String LIGHT1_GREEN = GFX_PATH + EASY + LIGHTS + "light1_green";
...@@ -90,6 +91,7 @@ public class SafeAssets { ...@@ -90,6 +91,7 @@ public class SafeAssets {
//======== SAFE HARD ============= //======== SAFE HARD =============
public static final String PEAK = GFX_PATH + HARD + "peak"; public static final String PEAK = GFX_PATH + HARD + "peak";
public static final String POINTER = GFX_PATH + HARD + "pointer"; public static final String POINTER = GFX_PATH + HARD + "pointer";
public static final String HARD_BACKGROUND = GFX_PATH + HARD + "background";
public static final String HARD_LIGHT1 = GFX_PATH + HARD + "1"; public static final String HARD_LIGHT1 = GFX_PATH + HARD + "1";
public static final String HARD_LIGHT2 = GFX_PATH + HARD + "2"; public static final String HARD_LIGHT2 = GFX_PATH + HARD + "2";
public static final String HARD_LIGHT3 = GFX_PATH + HARD + "3"; public static final String HARD_LIGHT3 = GFX_PATH + HARD + "3";
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment