Commit bf944c7d authored by Luboš Horáček's avatar Luboš Horáček

:Merge branch 'devel' of gitlab.labs.nic.cz:labs/tablexia into devel

parents 78898da8 b119fb55
......@@ -137,7 +137,6 @@ public class NocniSledovaniActivity extends GameActivity {
@Override
protected Void doInBackground(Void... params) {
try {
Log.d(TAG, "Showing solution for: " + (SOLUTION_SHOW_TIME * 1000));
showRoundSolution();
Thread.sleep((long) (SOLUTION_SHOW_TIME * 1000));
} catch (InterruptedException e) {
......@@ -187,7 +186,6 @@ public class NocniSledovaniActivity extends GameActivity {
@Override
public void onPopulateScene(Scene pScene, final OnPopulateSceneCallback pOnPopulateSceneCallback) throws IOException {
Log.d(TAG, "In OnPopulateScene");
initGame(new LoaderCallback() {
@Override
public void onLoadFinished() {
......@@ -212,6 +210,7 @@ public class NocniSledovaniActivity extends GameActivity {
protected void resetGame() {
super.resetGame();
numberOfWrongWindowsGuessed = 0;
numberOfWrongTimeValuesGuessed = 0;
currentRoundGeneratedTime = 0;
currentLevel = 0;
......@@ -275,7 +274,6 @@ public class NocniSledovaniActivity extends GameActivity {
@Override
protected void showGame() {
Log.d(TAG, "IN SHOW GAME");
super.showGame();
DelayModifier modifier = new DelayModifier(START_DELAY);
mfxManager.playAmbientSound(MfxManager.SOUND_DAY);
......@@ -369,7 +367,6 @@ public class NocniSledovaniActivity extends GameActivity {
*/
private void animateDayToNight(float delay) {
subscene.disableHourHand();
Log.d(TAG, "started animating day to night");
mfxManager.playSound(MfxManager.SOUND_TRANSITIONS_EVENING[random.nextInt(MfxManager.SOUND_TRANSITIONS_EVENING.length)]);
DelayModifier dm = new DelayModifier(delay, new MyDelayedImageSwitchModifierListener(scene, backGroundAnimationSprites.get(1)));
DelayModifier dm2 = new DelayModifier(delay, new MyDelayedImageSwitchModifierListener(scene, backGroundAnimationSprites.get(2)));
......@@ -377,7 +374,6 @@ public class NocniSledovaniActivity extends GameActivity {
@Override
public void onModifierFinished(IModifier<IEntity> pModifier, IEntity pItem) {
super.onModifierFinished(pModifier, pItem);
Log.d(TAG, "finished animating day to night");
lightUpWindowsAndShowTime();
mfxManager.playAmbientSound(MfxManager.SOUND_NIGHT);
}
......@@ -391,7 +387,6 @@ public class NocniSledovaniActivity extends GameActivity {
* Method animates the background from night sprite to day sprite
*/
private void animateNightToDay(final float delay) {
Log.d(TAG, "Started animating night to day");
mfxManager.playSound(MfxManager.SOUND_TRANSITIONS_MORNING[random.nextInt(MfxManager.SOUND_TRANSITIONS_MORNING.length)]);
DelayModifier delayBeforeAnimationStart = new DelayModifier(ANIMATION_TO_SHOWTIME_DELAY);
DelayModifier dm = new DelayModifier(delay, new MyDelayedImageSwitchModifierListener(scene, backGroundAnimationSprites.get(4)));
......@@ -405,7 +400,6 @@ public class NocniSledovaniActivity extends GameActivity {
subscene.enableHourhand();
scene.setOnSceneTouchListener(onWindowClickListener);
mfxManager.playAmbientSound(MfxManager.SOUND_DAY);
Log.d(TAG, "Finished animating night to day");
}
});
......@@ -418,8 +412,6 @@ public class NocniSledovaniActivity extends GameActivity {
final Map<Integer, List<Integer>> generatedSequence = generatedSequencesForLevels.get(currentLevel);
Set<Integer> sequenceKeySet = generatedSequence.keySet();
generatedTimeValues = new ArrayList<Integer>(sequenceKeySet);
Log.d("NUMBER_OF GENERATED VLAUES", Integer.toString(generatedTimeValues.size()));
Log.d(TAG, "Started lighting up windows");
PauseableTimerHandler animationToAnimationPauseableHandler = new PauseableTimerHandler(ANIMATION_TO_SHOWTIME_DELAY, false, new ITimerCallback() {
......@@ -433,7 +425,6 @@ public class NocniSledovaniActivity extends GameActivity {
onWindowClickListener.lightUpWindow(windowIndex);
}
subscene.setTimeOnWatch(new int[] { currentRoundGeneratedTime, 0 }, 0);
Log.d(TAG, "Setting sprites visible");
PauseableTimerHandler windowHandler = new PauseableTimerHandler(windowLidTime, false, new ITimerCallback() {
@Override
......@@ -454,9 +445,7 @@ public class NocniSledovaniActivity extends GameActivity {
}
private void hideContinue() {
Log.d(TAG, "Started hiding continue");
toggleView(false, btnContinue);
Log.d(TAG, "Finished hiding continue");
}
private void showContinue() {
......@@ -517,7 +506,6 @@ public class NocniSledovaniActivity extends GameActivity {
getGameManager().setExtraInt2AndSave(++numberOfWrongTimeValuesGuessed);
}
Log.d("RESULT", "WW: " + numberOfWrongWindowsGuessed + " WT: " + numberOfWrongTimeValuesGuessed);
Log.d(TAG, "Finished evaluating round");
}
/*
......@@ -537,16 +525,13 @@ public class NocniSledovaniActivity extends GameActivity {
}
private void clearScene() {
Log.d(TAG, "Started clearing scene");
subscene.setTimeOnWatch(new int[] { 0, 0 }, 0);
onWindowClickListener.lightDownAllWindows();
scene.setOnSceneTouchListener(null);
lightWindows.clear();
Log.d(TAG, "Finished clearing scene");
}
private void setWindowListener() {
Log.d("TAG", "Started creating window listener");
onWindowClickListener = new WindowListener(this, difficulty, gfxManager, new Point((int) background.getWidth(), (int) background.getHeight()), lightWindows, getTextureManager(), getVertexBufferObjectManager(), camera, getAssets(), scene) {
@Override
protected void onLightWindowClickAction(int windowIndex) {
......@@ -569,7 +554,6 @@ public class NocniSledovaniActivity extends GameActivity {
}
};
Log.d("TAG", "Ended creating window listener");
}
/*
......
......@@ -7,8 +7,6 @@ import org.andengine.entity.scene.background.SpriteBackground;
import org.andengine.entity.sprite.Sprite;
import org.andengine.util.modifier.IModifier;
import android.util.Log;
public class MyDelayedImageSwitchModifierListener implements IEntityModifierListener {
private static final String TAG = MyDelayedImageSwitchModifierListener.class.getSimpleName();
private Sprite sprite;
......@@ -26,7 +24,6 @@ public class MyDelayedImageSwitchModifierListener implements IEntityModifierList
@Override
public void onModifierFinished(IModifier<IEntity> pModifier, IEntity pItem) {
Log.d(TAG, "Finished modifier - " + sprite.toString());
scene.setBackground(new SpriteBackground(sprite));
}
......
......@@ -96,7 +96,6 @@ public class WindowListener implements IOnSceneTouchListener {
touchedColorTrio = new Trio<Integer, Integer, Integer>(android.graphics.Color.red(pixel), android.graphics.Color.green(pixel), android.graphics.Color.blue(pixel));
if (colorMap.containsKey(touchedColorTrio)) {
int touchedWindowId = colorMap.get(touchedColorTrio);
Log.d("TOUCHED window", Integer.toString(touchedWindowId));
if (lightWindows.contains(Integer.valueOf(touchedWindowId))) {
......@@ -150,7 +149,6 @@ public class WindowListener implements IOnSceneTouchListener {
window.setTag(windowIndex);
lidWindowsSprites.put(windowIndex, window);
window.setAlpha(0);
Log.d(TAG, "Attaching child number: "+windowIndex);
scene.attachChild(window);
window.registerEntityModifier(new AlphaModifier(0.3f, 0, 1));
......@@ -160,14 +158,12 @@ public class WindowListener implements IOnSceneTouchListener {
* Lights down specifiedWindow
*/
public void lightDownWindow(final int windowIndex) {
Log.d(TAG, "lightDownWindow: "+windowIndex);
if (scene.getChildByTag(windowIndex) != null) {
final IEntity spriteToBeDetached = scene.getChildByTag(windowIndex);
Log.d(TAG, "ENGINE: " + parentActivity.getEngine());
parentActivity.runOnUpdateThread(new Runnable() {
@Override
public void run() {
Log.d(TAG, "Detaching window number: " + windowIndex);
spriteToBeDetached.detachSelf();
}
});
......@@ -180,7 +176,6 @@ public class WindowListener implements IOnSceneTouchListener {
* Lights down all windows on scene
*/
public void lightDownAllWindows() {
Log.d(TAG, "Lighting down all windows");
if (lidWindowsSprites != null) {
for (Integer windowID : lidWindowsSprites.keySet()) {
lightDownWindow(windowID);
......@@ -210,7 +205,6 @@ public class WindowListener implements IOnSceneTouchListener {
}
public void showSolution(List<Integer> generatedWindowNumbers) {
Log.d(TAG, "showSolution()");
Map<Integer, Sprite> lidWindowsSpritesCopy = new HashMap<Integer, Sprite>(lidWindowsSprites);
lightDownAllWindows();
......@@ -225,7 +219,6 @@ public class WindowListener implements IOnSceneTouchListener {
}
public void clearScene() {
Log.d(TAG, "clearScene()");
lightDownAllWindows();
lidWindowsSprites.clear();
}
......
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