I had to do something VERY similar just yesterday!
This should give you an idea. I’m writing this at work so don’t expect this to go perfectly.
int alpha = 0;
public static void render(Graphics g) {
for (int x = 0; x < GameClass.display.width; x += YourImage.getWidth()) {
for (int y = 0; y < GameClass.display.height; y += YourImage.getHeight()) {
g.drawImage(YourImage, x, y);
}
}
g.setColor(new Color(0, 0, 0, alpha));
g.fillRect(0, 0, GameClass.display.width, GameClass.display.height);
alpha++;
}
This basically tiles an image and draws an alpha mask over it that gets darker as the game ticks.
For a day/night cycle you should just set the alpha to go up when it’s night time and for it to go down when it’s day time.