It seems that when the timer in the main game reaches 2:00 AM, the game crashes from a NullPointerException.
Steps to Reproduce
Enter the main game area
Wait until the timer reaches 2:00
Expected Behaviour
I expect that at this point the game is meant to transition into a lose screen concerning the lose via time-out fail condition.
Actual Behaviour
The game freezes for a moment before closing/crashing.
Additional Comments
This is my current call stack:
Exception in thread "main" java.lang.NullPointerException
at com.deco2800.game.screens.maingame.MainGameTextDisplay.update(MainGameTextDisplay.java:107)
at com.deco2800.game.generic.Component.triggerUpdate(Component.java:85)
at com.deco2800.game.entities.Entity.update(Entity.java:253)
at com.deco2800.game.entities.EntityService.update(EntityService.java:46)
at com.deco2800.game.screens.maingame.MainGameScreen.render(MainGameScreen.java:107)
at com.badlogic.gdx.Game.render(Game.java:46)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:403)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:143)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:116)
at com.deco2800.game.desktop.DesktopLauncher.main(DesktopLauncher.java:11)
Upon first investigation it seems the exception is coming from within update() in MainGameTextDisplay. Specifically, the first line long currentTime = ServiceLocator.getTimeSource().getTime();.
Description
Issue
It seems that when the timer in the main game reaches 2:00 AM, the game crashes from a NullPointerException.
Steps to Reproduce
Expected Behaviour
I expect that at this point the game is meant to transition into a lose screen concerning the lose via time-out fail condition.
Actual Behaviour
The game freezes for a moment before closing/crashing.
Additional Comments
This is my current call stack:
Upon first investigation it seems the exception is coming from within
update()
inMainGameTextDisplay
. Specifically, the first linelong currentTime = ServiceLocator.getTimeSource().getTime();
.