diff --git a/cicaprojekt/FlowOfTime.java b/cicaprojekt/FlowOfTime.java index 496a372..c6c1d9c 100644 --- a/cicaprojekt/FlowOfTime.java +++ b/cicaprojekt/FlowOfTime.java @@ -6,8 +6,18 @@ import java.util.TimerTask; public class FlowOfTime extends Timer { private TimerTask timeup; private long gametime; + private Game game; - public void start() { + private class GameOver extends TimerTask { + + @Override + public void run() { + game.stopGame(); + } + } + + public void start(long delay) { + schedule(new GameOver(), delay); } }