Lab1 Done Done
This commit is contained in:
parent
f6f598adff
commit
e607251cb3
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user