Lab1 Done Done

This commit is contained in:
Artyom_Yashin 2023-10-28 15:54:05 +04:00
parent f6f598adff
commit e607251cb3
2 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ public class DrawingAirBomber extends JPanel {
private final int PLANE_HEIGHT = 160;
private DrawingEngines drawingEngines;
public boolean init(int speed, double weight, Color bodyColor, Color
additionalColor, boolean bombs, boolean fuel, int width, int height, int blocksNumber)
additionalColor, boolean bombs, boolean fuel, int width, int height, int enginesNumber)
{
if (PLANE_WIDTH > width || PLANE_HEIGHT > height)
return false;
@ -24,7 +24,7 @@ public class DrawingAirBomber extends JPanel {
entityAirBomber.init(speed, weight, bodyColor, additionalColor,
bombs, fuel);
drawingEngines = new DrawingEngines();
drawingEngines.setNumber(blocksNumber);
drawingEngines.setNumber(enginesNumber);
return true;
}
public void setPosition(int x, int y)
@ -136,6 +136,6 @@ public class DrawingAirBomber extends JPanel {
g.setColor(penColor);
g.drawPolygon(pointX, pointY,8);
}
drawingEngines.drawBlocks(g, _startPosX, _startPosY);
drawingEngines.drawEngines(g, _startPosX, _startPosY);
}
}

View File

@ -10,7 +10,7 @@ public class DrawingEngines {
if(x >= 6)
number = EngineNumber.SIX;
}
public void drawBlocks(Graphics2D graphics2D, int _startX, int _startY){
public void drawEngines(Graphics2D graphics2D, int _startX, int _startY){
graphics2D.fillRect(_startX+70, _startY+20, 20, 15);
graphics2D.fillOval(_startX+80, _startY+20, 20, 15);
graphics2D.fillRect(_startX+70, _startY+125, 20, 15);