MCPcopy Create free account
hub / github.com/catabriga/graphwar / drawBackground

Method drawBackground

src/Graphwar/GraphPlane.java:268–283  ·  view source on GitHub ↗
(Graphics2D g, boolean reversed)

Source from the content-addressed store, hash-verified

266 }
267
268 private void drawBackground(Graphics2D g, boolean reversed)
269 {
270 if(reversed)
271 {
272 g.drawImage(graphwar.getGameData().getObstacle().getImage(), 0, 0, Constants.PLANE_LENGTH, Constants.PLANE_HEIGHT, Constants.PLANE_LENGTH, 0, 0, Constants.PLANE_HEIGHT, null);
273 }
274 else
275 {
276 g.drawImage(graphwar.getGameData().getObstacle().getImage(), 0, 0, null);
277 }
278
279 g.setColor(Color.BLACK);
280
281 g.drawLine(0, Constants.PLANE_HEIGHT/2, Constants.PLANE_LENGTH, Constants.PLANE_HEIGHT/2);
282 g.drawLine(Constants.PLANE_LENGTH/2, 0, Constants.PLANE_LENGTH/2, Constants.PLANE_HEIGHT);
283 }
284
285 public void startDrawingFunction()
286 {

Callers 1

paintComponentMethod · 0.95

Calls 3

getImageMethod · 0.80
getObstacleMethod · 0.80
getGameDataMethod · 0.80

Tested by

no test coverage detected