Skip to content

Commit

Permalink
Slowed timer down, added minus as shortcut to loss key.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jantoom committed Nov 4, 2021
1 parent 907ce33 commit 90d9d6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.badlogic.gdx.math.Vector2;
import com.deco2800.game.generic.ServiceLocator;
import com.deco2800.game.screens.game.GameScreen;
import com.deco2800.game.screens.game.TimerWidget;
import com.deco2800.game.utils.math.Vector2Utils;

/**
Expand Down Expand Up @@ -70,6 +71,9 @@ public boolean keyDown(int keycode) {
case Keys.O:
ServiceLocator.getScreen(GameScreen.class).getGameUI().getEvents().trigger("toggle_chores");
return true;
case Keys.MINUS:
ServiceLocator.getScreen(GameScreen.class).getGameUI().getComponent(TimerWidget.class).setTimerTime(155);
return true;
default:
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class TimerWidget extends RetroactiveWidget {
private static final String TIMER_BACKGROUND = "images/ui/elements/Textbox_256.png";
private static final int TIMER_START = 2300;
private static final int TIMER_END = 200;
private static final long TIMER_TICK_RATE = 500L;
private static final long TIMER_TICK_RATE = 2000L;
private long lastTime = 0L;
private Label timerLabel;
private TimerStatus timerStatus = TimerStatus.NORMAL;
Expand Down Expand Up @@ -47,6 +47,10 @@ public int getMinutes() {
return timerTime % 100;
}

public void setTimerTime(int timerTime) {
this.timerTime = timerTime;
}

@Override
public void update() {
long currentTime = ServiceLocator.getTimeSource().getTime();
Expand Down

0 comments on commit 90d9d6b

Please sign in to comment.