From 19003ab1f173231f720bf084b60cbb2522cae648 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 8 Sep 2015 19:49:34 +0200 Subject: [PATCH] Improve backgroud flashing --- .../de/sopa/scene/justplay/JustPlayGameScene.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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);