Skip to content

Commit

Permalink
wait 1,5 sec before leaving solved levelGameScene
Browse files Browse the repository at this point in the history
  • Loading branch information
djschilling committed Apr 11, 2015
1 parent 87e60e5 commit 5aa5ed1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/src/main/java/de/sopa/scene/game/LevelModeGameScene.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pT

@Override
public void onBackKeyPressed() {
leaveScene = true;
sceneService.loadLevelChoiceSceneFromGameScene();
if(!leaveScene) {
sceneService.loadLevelChoiceSceneFromGameScene();
}
}

public void onSolvedGame() {
Expand All @@ -48,13 +49,12 @@ public void onSolvedGame() {
levelService.persistLevelResult(levelResult);
int nextLevelId = level.getId() + 1;
levelService.unlockLevel(nextLevelId);
engine.registerUpdateHandler(new TimerHandler(1.5f, new ITimerCallback() {
this.leaveScene = true;
engine.registerUpdateHandler(new TimerHandler(1.5f,new ITimerCallback() {
@Override
public void onTimePassed(TimerHandler pTimerHandler) {
if (!leaveScene) {
engine.unregisterUpdateHandler(pTimerHandler);
sceneService.loadScoreScreen(levelResult);
}
engine.unregisterUpdateHandler(pTimerHandler);
sceneService.loadScoreScreen(levelResult);
}
}));

Expand Down

0 comments on commit 5aa5ed1

Please sign in to comment.