stoped task at game end

This commit is contained in:
2026-02-11 20:56:26 +01:00
parent 27005f4fc4
commit e1515200ab

View File

@@ -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);