PIbd-22_Aleikin_A.M._AirBom.../DrawningWarplane.java

43 lines
1.3 KiB
Java
Raw Normal View History

2022-12-13 21:37:45 +04:00
import java.awt.*;
public class DrawningWarplane extends DrawningBomber
{
public DrawningWarplane(int speed, float weight, Color bodyColor, Color dopColor, boolean engines, boolean weapons)
{
2022-12-13 22:45:40 +04:00
super(speed, weight, bodyColor, 120, 120);
2022-12-13 21:37:45 +04:00
AirBomber = new EntityWarplane(speed, weight, bodyColor, dopColor, engines, weapons);
}
@Override
public void DrawTransport(Graphics g)
{
if (!(AirBomber instanceof EntityWarplane warplane))
{
return;
}
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(Color.BLACK);
g2d.setColor(warplane.GetDopColor());
if (warplane.GetEngines())
{
2022-12-13 22:45:40 +04:00
g2d.fillOval((int)_startPosX + 50, (int)_startPosY + 40, 30, 15);
g2d.fillOval( (int)_startPosX + 45, (int)_startPosY + 60, 35, 15);
g2d.fillOval( (int)_startPosX + 45, (int)_startPosY + 95, 35, 15);
g2d.fillOval( (int)_startPosX + 50, (int)_startPosY + 115, 30, 15);
2022-12-13 21:37:45 +04:00
}
_startPosY += 25;
super.DrawTransport(g);
_startPosY -= 25;
if (warplane.GetWeapons())
{
2022-12-13 22:45:40 +04:00
g2d.fillRect((int)_startPosX + 40,(int) _startPosY + 20, 30, 5);
g2d.fillRect( (int)_startPosX + 40, (int)_startPosY + 140, 30, 5);
2022-12-13 21:37:45 +04:00
}
}
}