package de.sopa.scene.justplay;

import de.sopa.model.justplay.JustPlayLevel;
import de.sopa.model.justplay.JustPlayLevelResult;
import de.sopa.scene.game.GameScene;
import org.andengine.engine.handler.timer.ITimerCallback;
import org.andengine.engine.handler.timer.TimerHandler;

/**
 * David Schilling - davejs92@gmail.com
 **/
public class JustPlayGameScene extends GameScene {

    private final JustPlayLevel level;

    public JustPlayGameScene(JustPlayLevel level) {
        super(level.getLevel());
        this.level = level;
    }

    @Override
    protected void addCustomLabels() {

    }

    @Override
    protected void addButtons() {

    }

    @Override
    public void onBackKeyPressed() {
        storyService.loadMenuSceneFromJustPlayGameScene();
    }

    @Override
    public void onSolvedGame() {
        engine.registerUpdateHandler(new TimerHandler(1.5f,new ITimerCallback() {
            @Override
            public void onTimePassed(TimerHandler pTimerHandler) {
                engine.unregisterUpdateHandler(pTimerHandler);
                storyService.loadJustPlayScoreSceneFromJustPlayScene(new JustPlayLevelResult(level.getLeftTime() - 12, gameService.getLevel().getMovesCount()));
            }
        }));
    }
}

@@ -272,16 +272,55 @@
 Handler;
+%0Aimport org.andengine.entity.text.Text;
 %0A%0A/**%0A *
@@ -452,16 +452,43 @@
 l level;
+%0A    private Text leftTime;
 %0A%0A    pu
@@ -607,32 +607,32 @@
 %0A%0A    @Override%0A
-
     protected vo
@@ -649,24 +649,450 @@
 omLabels() %7B
+%0A        leftTime = new Text(camera.getWidth() * 0.67f, camera.getHeight() * 0.83f, resourcesManager.scoreFont, String.valueOf(12), 6, vbom);%0A        attachChild(leftTime);%0A        Text leftTimeText= new Text(camera.getWidth() * 0.67f, camera.getHeight() * 0.81f, resourcesManager.levelFont, %22Left Time%22, vbom);%0A        leftTimeText.setScaleCenter(0, 0);%0A        leftTimeText.setScale(0.3f);%0A        attachChild(leftTimeText);
 %0A%0A    %7D%0A%0A   

Add LeftTime Textfield on JustPlayScene