diff --git a/source/core/src/main/com/deco2800/game/input/components/KeyboardPlayerInputComponent.java b/source/core/src/main/com/deco2800/game/input/components/KeyboardPlayerInputComponent.java index 435eaa6c..6c67dcab 100644 --- a/source/core/src/main/com/deco2800/game/input/components/KeyboardPlayerInputComponent.java +++ b/source/core/src/main/com/deco2800/game/input/components/KeyboardPlayerInputComponent.java @@ -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; /** @@ -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; } diff --git a/source/core/src/main/com/deco2800/game/screens/game/TimerWidget.java b/source/core/src/main/com/deco2800/game/screens/game/TimerWidget.java index 2e4b5f6e..dc0e6d9f 100644 --- a/source/core/src/main/com/deco2800/game/screens/game/TimerWidget.java +++ b/source/core/src/main/com/deco2800/game/screens/game/TimerWidget.java @@ -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; @@ -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();