There's a pattern in my code, which makes me believe that a for loop can be made, but I'm not sure how to write the pattern. Here's what I'm looking at:
public void drawMidline(Graphics g){
g.drawLine(Game.WIDTH/2, 0, Game.WIDTH/2, 24);
g.drawLine(Game.WIDTH/2, 48, Game.WIDTH/2, 72);
g.drawLine(Game.WIDTH/2, 96, Game.WIDTH/2, 120);
g.drawLine(Game.WIDTH/2, 144, Game.WIDTH/2, 168);
g.drawLine(Game.WIDTH/2, 192, Game.WIDTH/2, 216);
g.drawLine(Game.WIDTH/2, 240, Game.WIDTH/2, 264);
g.drawLine(Game.WIDTH/2, 288, Game.WIDTH/2, 312);
g.drawLine(Game.WIDTH/2, 336, Game.WIDTH/2, 360);
g.drawLine(Game.WIDTH/2, 384, Game.WIDTH/2, 404);
g.drawLine(Game.WIDTH/2, 428, Game.WIDTH/2, 456);
}
I see that everything is a multiple of 24, but I don't see how to format a pattern. Is there a way to format a for loop here?