When the player killed all the enemy ship but doesn't move on to the next stage and freeze.
BUG DESCRIPTION
The screen stops momentarily when the enemy is killed. At this time, the level at which the screen stops is random.
Exception` in thread "main" java.lang.NullPointerException: Cannot read the array length because "image" is null
at engine.DrawManager.drawEntity(DrawManager.java:253)
at screen.GameScreen.draw(GameScreen.java:438)
at screen.GameScreen.update(GameScreen.java:350)
at screen.Screen.run(Screen.java:89)
at screen.GameScreen.run(GameScreen.java:253)
at engine.Frame.setScreen(Frame.java:59)
at engine.Core.main(Core.java:172)
As far as I'm concerned, adding the following code to DrawEntivity's DrawManager.java's DrawEntity method will eliminate the bug, but it doesn't seem to be a fundamental solution. Please check carefully where the method is called.
if (image == null) {
System.err.println("Error: Image not found for sprite type: " + entity.getSpriteType());
return;
}
BUG SUMMARY
When the player killed all the enemy ship but doesn't move on to the next stage and freeze.
BUG DESCRIPTION
The screen stops momentarily when the enemy is killed. At this time, the level at which the screen stops is random.
As far as I'm concerned, adding the following code to DrawEntivity's DrawManager.java's DrawEntity method will eliminate the bug, but it doesn't seem to be a fundamental solution. Please check carefully where the method is called.
RUN SCREEN
https://github.com/user-attachments/assets/bc95e80b-e39b-44f7-bd5d-78739a6305ab