diff --git a/ProjectStormtrooper/DrawingEnginesEllipse.java b/ProjectStormtrooper/DrawingEnginesEllipse.java index 9a1e98f..7a82d78 100644 --- a/ProjectStormtrooper/DrawingEnginesEllipse.java +++ b/ProjectStormtrooper/DrawingEnginesEllipse.java @@ -23,17 +23,9 @@ public class DrawingEnginesEllipse implements IDrawingEngines { @Override public void DrawEngine(Graphics2D g2d, Color color, int x, int y, int w, int h) { - Polygon enginePolygon = new Polygon(); - enginePolygon.addPoint(x, y + h / 2); - enginePolygon.addPoint(x + w / 10, y); - enginePolygon.addPoint(x + w - w / 2, y + h / 2); - enginePolygon.addPoint(x + w, y); - enginePolygon.addPoint(x + w, y + h); - enginePolygon.addPoint(x + w - w / 2, y + h / 2); - enginePolygon.addPoint(x + w / 10, y + h); g2d.setColor(Color.WHITE); - g2d.fillPolygon(enginePolygon); + g2d.fillOval(x, y, w, h); g2d.setColor(Color.BLACK); - g2d.drawPolygon(enginePolygon); + g2d.drawOval(x, y, w, h); } } diff --git a/ProjectStormtrooper/DrawingEnginesWithFlame.java b/ProjectStormtrooper/DrawingEnginesPyramid.java similarity index 57% rename from ProjectStormtrooper/DrawingEnginesWithFlame.java rename to ProjectStormtrooper/DrawingEnginesPyramid.java index 83caabb..9df287c 100644 --- a/ProjectStormtrooper/DrawingEnginesWithFlame.java +++ b/ProjectStormtrooper/DrawingEnginesPyramid.java @@ -2,7 +2,7 @@ package ProjectStormtrooper; import java.awt.*; -public class DrawingEnginesWithFlame implements IDrawingEngines { +public class DrawingEnginesPyramid implements IDrawingEngines { private EnumEnginesCount _enumEnginesCount; @Override @@ -23,9 +23,17 @@ public class DrawingEnginesWithFlame implements IDrawingEngines { @Override public void DrawEngine(Graphics2D g2d, Color color, int x, int y, int w, int h) { + Polygon enginePolygon = new Polygon(); + enginePolygon.addPoint(x, y + h / 2); + enginePolygon.addPoint(x + w / 10, y); + enginePolygon.addPoint(x + w - w / 2, y + h / 2); + enginePolygon.addPoint(x + w, y); + enginePolygon.addPoint(x + w, y + h); + enginePolygon.addPoint(x + w - w / 2, y + h / 2); + enginePolygon.addPoint(x + w / 10, y + h); g2d.setColor(Color.WHITE); - g2d.fillOval(x, y, w, h); + g2d.fillPolygon(enginePolygon); g2d.setColor(Color.BLACK); - g2d.drawOval(x, y, w, h); + g2d.drawPolygon(enginePolygon); } } diff --git a/ProjectStormtrooper/DrawingEngines.java b/ProjectStormtrooper/DrawingEnginesSimple.java similarity index 93% rename from ProjectStormtrooper/DrawingEngines.java rename to ProjectStormtrooper/DrawingEnginesSimple.java index 616f666..1eb068c 100644 --- a/ProjectStormtrooper/DrawingEngines.java +++ b/ProjectStormtrooper/DrawingEnginesSimple.java @@ -2,7 +2,7 @@ package ProjectStormtrooper; import java.awt.*; -public class DrawingEngines implements IDrawingEngines { +public class DrawingEnginesSimple implements IDrawingEngines { private EnumEnginesCount _enumEnginesCount; @Override diff --git a/ProjectStormtrooper/DrawingPlane.java b/ProjectStormtrooper/DrawingPlane.java index 9b89b0a..8b5e9f5 100644 --- a/ProjectStormtrooper/DrawingPlane.java +++ b/ProjectStormtrooper/DrawingPlane.java @@ -39,11 +39,11 @@ public class DrawingPlane { Random random = new Random(); int drawingEnginesType = random.nextInt(0, 3); if (drawingEnginesType == 0) - _drawingEngines = new DrawingEngines(); + _drawingEngines = new DrawingEnginesSimple(); else if (drawingEnginesType == 1) - _drawingEngines = new DrawingEnginesEllipse(); + _drawingEngines = new DrawingEnginesPyramid(); else if (drawingEnginesType == 2) - _drawingEngines = new DrawingEnginesWithFlame(); + _drawingEngines = new DrawingEnginesEllipse(); } protected DrawingPlane(int speed, double weight, Color bodyColor,