stoped task at game end
This commit is contained in:
@@ -33,6 +33,7 @@ public class ColorJump extends StatelessGame {
|
||||
);
|
||||
private Block currentBlock;
|
||||
private double roundTime = 5;
|
||||
private final double multiplierNextRoundTime = 0.9;
|
||||
|
||||
public ColorJump() {
|
||||
super(Dimension.THE_END.key, "ColorJump", new LastWinsScore());
|
||||
@@ -67,16 +68,17 @@ public class ColorJump extends StatelessGame {
|
||||
TaskSchedule stop = TaskSchedule.stop();
|
||||
|
||||
scheduler.scheduleTask(() -> {
|
||||
if(!this.isRunning) return stop;
|
||||
this.destroyAllExcept(this.currentBlock);
|
||||
|
||||
scheduler.scheduleTask(() -> {
|
||||
this.nextRound();
|
||||
if(this.isRunning) this.nextRound();
|
||||
return stop;
|
||||
}, TaskSchedule.seconds(3));
|
||||
return stop;
|
||||
}, TaskSchedule.seconds((long) this.roundTime));
|
||||
if(this.roundTime > 0.5)
|
||||
this.roundTime = this.roundTime * 0.9;
|
||||
this.roundTime = this.roundTime * this.multiplierNextRoundTime;
|
||||
|
||||
long secondsLeft = Math.max(0, (long) this.roundTime);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user