This commit is contained in:
Павел Путилин 2022-10-30 13:58:30 +04:00
parent 837430e6ef
commit 578c521364

View File

@ -33,7 +33,7 @@ namespace AirplaneWithRadar
/// <summary>
/// Высота отрисовки самолёта
/// </summary>
private readonly int _airplaneHeight = 10;
private readonly int _airplaneHeight = 20;
/// <summary>
/// Инициализация свойств
/// </summary>
@ -120,38 +120,39 @@ namespace AirplaneWithRadar
}
Pen pen = new(Color.Black);
Brush brush = new SolidBrush(Airplane.BodyColor);
int h = 10;
_startPosY += 4;
//корпус
g.DrawRectangle(pen, _startPosX, _startPosY + _airplaneHeight-7,
_airplaneWidth-5, _airplaneHeight);
g.DrawRectangle(pen, _startPosX, _startPosY + h - 7, _airplaneWidth - 15, h);
//нос
PointF[] point = new PointF[3];
point[0] = new PointF(_startPosX + _airplaneWidth-5, _startPosY + _airplaneHeight / 3);
point[1] = new PointF(_startPosX + _airplaneWidth+10 , _startPosY + _airplaneHeight-3);
point[2] = new PointF(_startPosX + _airplaneWidth-5, _startPosY + _airplaneHeight + (_airplaneHeight / 3));
point[0] = new PointF(_startPosX + _airplaneWidth - 15, _startPosY + h / 3);
point[1] = new PointF(_startPosX + _airplaneWidth, _startPosY + h - 3);
point[2] = new PointF(_startPosX + _airplaneWidth - 15, _startPosY + h + (h / 3));
g.FillPolygon(brush, point);
//хвост
point = new PointF[3];
point[0] = new PointF(_startPosX, _startPosY - 10);
point[1] = new PointF(_startPosX, _startPosY + _airplaneHeight / 3);
point[2] = new PointF(_startPosX + 15, _startPosY + _airplaneHeight / 3);
point[1] = new PointF(_startPosX, _startPosY + h / 3);
point[2] = new PointF(_startPosX + 15, _startPosY + h / 3);
g.FillPolygon(brush, point);
//крылья
g.DrawLine(pen, _startPosX + 20, _startPosY + _airplaneHeight - 3, _startPosX + 60, _startPosY + _airplaneHeight - 3);
g.DrawLine(pen, _startPosX + 20, _startPosY + _airplaneHeight - 2, _startPosX + 60, _startPosY + _airplaneHeight - 2);
g.DrawLine(pen, _startPosX + 20, _startPosY + h - 3, _startPosX + 60, _startPosY + h - 3);
g.DrawLine(pen, _startPosX + 20, _startPosY + h - 2, _startPosX + 60, _startPosY + h - 2);
g.DrawLine(pen, _startPosX-1, _startPosY + _airplaneHeight / 3, _startPosX + 15, _startPosY + _airplaneHeight / 3);
g.DrawLine(pen, _startPosX-1, _startPosY + _airplaneHeight / 3 + 1, _startPosX + 15, _startPosY + _airplaneHeight / 3 + 1);
g.DrawLine(pen, _startPosX-1, _startPosY + _airplaneHeight / 3 + 2, _startPosX + 15, _startPosY + _airplaneHeight / 3 + 2);
g.DrawLine(pen, _startPosX - 1, _startPosY + h / 3, _startPosX + 15, _startPosY + h / 3);
g.DrawLine(pen, _startPosX - 1, _startPosY + h / 3 + 1, _startPosX + 15, _startPosY + h / 3 + 1);
g.DrawLine(pen, _startPosX - 1, _startPosY + h / 3 + 2, _startPosX + 15, _startPosY + h / 3 + 2);
//колёса
g.DrawRectangle(pen, _startPosX + 20, _startPosY + _airplaneHeight + (_airplaneHeight / 3), 2, 2);
g.DrawRectangle(pen, _startPosX + 24, _startPosY + _airplaneHeight + (_airplaneHeight / 3), 2, 2);
g.DrawRectangle(pen, _startPosX + _airplaneWidth-20, _startPosY + _airplaneHeight + (_airplaneHeight / 3), 2, 2);
g.DrawRectangle(pen, _startPosX + 20, _startPosY + h + (h / 3), 2, 2);
g.DrawRectangle(pen, _startPosX + 24, _startPosY + h + (h / 3), 2, 2);
g.DrawRectangle(pen, _startPosX + _airplaneWidth - 20, _startPosY + h + (h / 3), 2, 2);
_startPosY -= 4;
}
/// <summary>
/// Смена границ формы отрисовки