diff --git a/app/src/main/java/de/sopa/scene/justplay/JustPlayGameScene.java b/app/src/main/java/de/sopa/scene/justplay/JustPlayGameScene.java index 9b5e0f73..0f2c9b04 100644 --- a/app/src/main/java/de/sopa/scene/justplay/JustPlayGameScene.java +++ b/app/src/main/java/de/sopa/scene/justplay/JustPlayGameScene.java @@ -36,21 +36,26 @@ public class JustPlayGameScene extends GameScene implements JustPlaySceneObserve public JustPlayGameScene(JustPlayLevel justPlayLevel) { super(justPlayLevel.getLevel()); - gameViewBackground = new Rectangle(0f, getTileSceneStartY() + spacePerTile, camera.getWidth(), camera.getWidth(), vbom); - gameViewBackground.setColor(1f,1f,1f,0f); - attachChild(gameViewBackground); leaveScene = false; + initializeWarningFlash(); timeBasedGameService = new TimeBasedGameServiceImpl(justPlayLevel.getLeftTime()); timeBasedGameService.start(); timeBasedGameService.attach(this); leftTime.setText(String.valueOf(justPlayLevel.getLeftTime())); } + private void initializeWarningFlash() { + gameViewBackground = new Rectangle(0f, getTileSceneStartY() + spacePerTile, camera.getWidth(), camera.getWidth(), vbom); + gameViewBackground.setColor(1f,1f,1f,0f); + attachChild(gameViewBackground); + } + public JustPlayGameScene(TimeBasedGameService timeBasedGameService, JustPlayLevel justPlayLevel) { super(justPlayLevel.getLevel()); leaveScene = false; + initializeWarningFlash(); this.timeBasedGameService = timeBasedGameService; timeBasedGameService.attach(this);