Skip to content
Snippets Groups Projects
Commit 5865a21f authored by Luboš Horáček's avatar Luboš Horáček
Browse files

Game errors

parent c0accaec
No related branches found
No related tags found
No related merge requests found
......@@ -109,11 +109,12 @@ public class KidnappingGame extends AbstractTablexiaGame<GameState> {
Log.info(getClass(), "Directions - next:" + getData().getNextDirection() + " prev: " + getData().getLastDirection());
final Direction[] directions = getNextDirections();
Log.info(getClass(), "Current soundsPack " + soundPack + ", directions: [" + getData().getNextDirection() + "]" + Arrays.toString(directions) + ", order " + Arrays.toString(soundPack.getSoundNamesInOrder(directions, getData().getNextDirection())));
map.addAction(Actions.sequence(new PlayExample(soundPack.getExample(this)), Actions.run(new Runnable() {
map.addAction(Actions.sequence(new PlayExample(soundPack.getExample(this)), Actions.run(new Runnable() { // show ear and play correct example sound
@Override
public void run() {
Music[] sounds = soundPack.getSoundsInOrder(KidnappingGame.this, directions, getData().getNextDirection());
final Arrow[] arrows = map.getDirectionArrow(position, directions);
// TODO log
map.addAction(Actions.sequence(ShowArrowAction.arrowsFadeIn(arrows), Actions.delay(0.5f), ArrowMusicAction.arrowSequence(sounds, arrows), ReplayAlphaAction.fadeIn(), Actions.run(new Runnable() {
public void run() {
final Arrow correct = arrows[(getData().getStep() == getData().getPath().size() - 1) ? getRandom().nextInt(arrows.length) : DirectionsHelper.getNextDirectionIndex(directions, getData().getNextDirection())];
......@@ -125,7 +126,7 @@ public class KidnappingGame extends AbstractTablexiaGame<GameState> {
@Override
public void clicked(InputEvent event, float x, float y) {
if (event.getTarget() == correct) {
map.addAction(Actions.sequence(CorrectAlphaAction.fadeIn(), CorrectAlphaAction.fadeOut(), ShowArrowAction.arrowsFadeOut(arrows), Actions.run(new Runnable() {
map.addAction(Actions.sequence(CorrectAlphaAction.fadeIn(), Actions.delay(0.1f),CorrectAlphaAction.fadeOut(), ShowArrowAction.arrowsFadeOut(arrows), Actions.run(new Runnable() {
@Override
public void run() {
correct();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment