Commit 475180d1 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

#407 Changed name. Added SideBar.

parent 90e0ddc6
......@@ -82,8 +82,8 @@ game_in_the_darkness_description=Procvičování seriality
game_in_the_darkness_preloader1=Naplánuj krok za krokem průchod labyrintem.
game_in_the_darkness_preloader2=Přetahuj správné úkony do pásu vpravo a\u00A0dávej pozor na všechny překážky. Teprve až budeš mít naplánovanou celou trasu, stiskni tlačítko HOTOVO.
game_runes_description = Runes desc
game_runes_title = Runes title
game_runes_description = Symbols desc
game_runes_title = Symbols title
# <!-- Robbery -->
robbery_1_finished=Pouta standard
robbery_1_finished_description=Za dohrání první hry
......
......@@ -82,8 +82,8 @@ game_in_the_darkness_description=Training der Serialität
game_in_the_darkness_preloader1=Plane Schritt für Schritt den\u00A0Weg duch das\u00A0Labyrinth.
game_in_the_darkness_preloader2=Ziehe die\u00A0richtigen Handlungen auf die\u00A0rechte Seite und\u00A0pass auf alle Hindernisse auf. Sobald du die\u00A0ganze Route geplant hast, drücke den\u00A0Knopf FERTIG.
game_runes_description=Runes desc
game_runes_title=Runes title
game_runes_description=Sybmols desc
game_runes_title=Symbols title
# <!-- Robbery -->
robbery_1_finished=Handschellen Standard
robbery_1_finished_description=Für das Beenden des ersten Spiels
......
......@@ -84,8 +84,8 @@ game_in_the_darkness_description=Precvičovanie seriality
game_in_the_darkness_preloader1=Naplánuj krok za krokom prechod labyrintom.
game_in_the_darkness_preloader2=Preťahuj správne úkony do pásu vpravo a\u00A0dávaj pozor na všetky prekážky. Až keď budeš mať naplánovanú celú trasu, stlač tlačítko HOTOVO.
game_runes_description=Runes desc
game_runes_title=Runes title
game_runes_description=Symbols desc
game_runes_title=Symbols title
# <!-- Robbery -->
robbery_1_finished=Púta štandard
robbery_1_finished_description=Za dohranie prvej hry
......
......@@ -64,7 +64,7 @@ public class Rune extends Image implements IRune {
public static Rune createInstance(GfxLibrary gfxLibrary, RuneDefinition runeDefinition, GameDifficulty gameDifficulty) {
TextureRegion tr = new TextureRegion(gfxLibrary.getTextureRegion(runeDefinition));
if (gameDifficulty.equals(GameDifficulty.MEDIUM)) tr.flip(false,true);
if (gameDifficulty.equals(GameDifficulty.MEDIUM)) tr.flip(true,false);
Rune r = new Rune(tr,runeDefinition);
return r;
......
package cz.nic.tablexia.game.games.runes.actors;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.utils.Align;
import java.util.List;
import cz.nic.tablexia.game.common.TablexiaRandom;
import cz.nic.tablexia.game.common.media.GfxLibrary;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
import cz.nic.tablexia.game.games.runes.assets.RuneDefinition;
import cz.nic.tablexia.game.games.runes.assets.RunesGameAssets;
import cz.nic.tablexia.loader.application.ApplicationFontManager;
import cz.nic.tablexia.screen.loader.LoadingBar;
import cz.nic.tablexia.util.ui.TablexiaLabel;
/**
* Created by Vitaliy Vashchenko on 18.7.16.
*/
public class Sidebar extends Group {
private TargetPlate targetPlate;
private TimeBar timeBar;
private Label score;
private Image background;
private static final String SCORE_TEXT = "Score: ";
private static final String SCORE_TEXT_TOTAL = "/44";
public Sidebar(GfxLibrary gfxLibrary, GfxLibrary runesLibrary, TablexiaRandom tablexiaRandom, Texture timeBarFg, Texture timeBarBg, TimeBar.TimeBarCallback timeBarCallback) {
background = new Image(gfxLibrary.getTextureRegion(RunesGameAssets.SIDEBAR_BACKGROUND));
targetPlate = new TargetPlate(gfxLibrary, runesLibrary, tablexiaRandom);
score = new TablexiaLabel(SCORE_TEXT + 0 + SCORE_TEXT_TOTAL, new TablexiaLabel.TablexiaLabelStyle(ApplicationFontManager.FontType_NEW.BOLD_18, Color.BLACK));
score.setAlignment(Align.center);
timeBar = new TimeBar(new LoadingBar.LoadingBarSkin(timeBarFg, timeBarBg, Color.WHITE), timeBarCallback);
addActor(background);
background.setFillParent(true);
addActor(targetPlate);
addActor(timeBar);
addActor(score);
}
public void performTimeStep() {
timeBar.performStep();
}
public void changeTimeBarCurrentValue(float newValue) {
timeBar.setCurrentPercentage(newValue);
}
public void setPositions() {
targetPlate.setPosition(getWidth() / 2 - targetPlate.getWidth() / 2, getHeight() - targetPlate.getHeight());
score.setPosition(getWidth() / 2 - score.getWidth() / 2, 0);
timeBar.setPosition(getWidth() / 2 - timeBar.getWidth() / 2, score.getHeight() + 10);
}
public void changeActiveTargets(GameDifficulty gameDifficulty, int round) {
targetPlate.changeTargets(gameDifficulty, round);
}
public List<RuneDefinition> getActiveTargets() {
return targetPlate.getActiveTargets();
}
public boolean foundAllRunes() {
return targetPlate.getActiveTargets().size() == 0;
}
public void nextRound(GameDifficulty gameDifficulty, int round) {
timeBar.startGameState();
changeActiveTargets(gameDifficulty, round);
showTargets();
}
public boolean isTarget(RuneDefinition runeDefinition) {
return targetPlate.isTarget(runeDefinition);
}
public void restoreTimeBar(){
timeBar.restoreClock();
}
public void hideTargets() {
targetPlate.setVisible(false);
}
public void showTargets() {
targetPlate.setVisible(true);
}
public void hideTime() {
timeBar.setVisible(false);
}
public void showTime() {
timeBar.setVisible(true);
}
public void hideScore() {
score.setVisible(false);
}
public void showScore() {
score.setVisible(true);
}
public void hideAll() {
hideTargets();
hideTime();
hideScore();
}
public void showAll() {
showScore();
showTargets();
showTime();
}
public void changeScore(int score) {
this.score.setText(SCORE_TEXT + score + SCORE_TEXT_TOTAL);
}
public void removeTargetRune(RuneDefinition runeDefinition) {
targetPlate.hideTarget(runeDefinition);
targetPlate.removeTarget(runeDefinition);
}
}
......@@ -42,6 +42,9 @@ public class TargetPlate extends Group{
plate.setPosition(PAD / 2, PAD / 2);
addActor(plate);
background.setVisible(false); // TODO: 18.7.16 remove background
root = new Table();
root.defaults().pad(INNER_PAD);
root.defaults().expand();
......
......@@ -9,6 +9,7 @@ public enum RunesGameAssets implements AssetDescription {
// TODO: 1.6.16 change bg images
// TODO: 28.6.16 Fix bad runes images
RUNE_BACKGROUND("rune-background"),
SIDEBAR_BACKGROUND("sidebar-background"),
BACKGROUND("background"),
BAR_FG("time-bar-fg"),
BAR_BG("time-bar-bg"),
......@@ -18,7 +19,7 @@ public enum RunesGameAssets implements AssetDescription {
RESULT_2("result2"),
RESULT_3("result3");
public static final RunesGameAssets[] TEXTURES = {BACKGROUND,RUNE_BACKGROUND,BAR_BG,BAR_FG};
public static final RunesGameAssets[] TEXTURES = {BACKGROUND,RUNE_BACKGROUND,SIDEBAR_BACKGROUND,BAR_BG,BAR_FG};
public static final RunesGameAssets[] SOUNDS = {RESULT_0,RESULT_1,RESULT_2,RESULT_3};
private String path;
......
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