Правки лабораторная 2

This commit is contained in:
nikbel2004@outlook.com 2023-10-08 00:30:07 +04:00
parent 37572c6e3c
commit 62e9cfef11
2 changed files with 8 additions and 17 deletions

View File

@ -112,18 +112,9 @@ namespace Tank
Brush BrushRandom = new SolidBrush(Tank?.BodyColor ?? Color.Black); Brush BrushRandom = new SolidBrush(Tank?.BodyColor ?? Color.Black);
//Корпус //Корпус
Brush WhiteColor = new SolidBrush(Color.White); Point[] pointsbody = { new Point(_startPosX + 5, _startPosY + 30), new Point(_startPosX + 110, _startPosY + 30),
g.FillRectangle(WhiteColor, _startPosX, _startPosY, 155, 30);
Point[] pointsbody1 = { new Point(_startPosX + 5, _startPosY + 30), new Point(_startPosX + 110, _startPosY + 30),
new Point(_startPosX + 142, _startPosY + 30), new Point(_startPosX + 120, _startPosY + 45), new Point(_startPosX + 12, _startPosY + 45) }; new Point(_startPosX + 142, _startPosY + 30), new Point(_startPosX + 120, _startPosY + 45), new Point(_startPosX + 12, _startPosY + 45) };
g.FillPolygon(BrushRandom, pointsbody1); g.FillPolygon(BrushRandom, pointsbody);
// Гусеница
g.FillRectangle(BrushRandom, 28 + _startPosX, 50 + _startPosY, 10, 3);
g.FillRectangle(BrushRandom, 53 + _startPosX, 50 + _startPosY, 10, 3);
g.FillRectangle(BrushRandom, 78 + _startPosX, 50 + _startPosY, 10, 3);
g.FillRectangle(BrushRandom, 103 + _startPosX, 50 + _startPosY, 10, 3);
// Колеса, катки // Колеса, катки
Brush ColorBlack = new SolidBrush(Color.Black); Brush ColorBlack = new SolidBrush(Color.Black);

View File

@ -37,19 +37,19 @@ namespace Tank.DrawningObjects
if (ArmoVehicle.Caterpillar) if (ArmoVehicle.Caterpillar)
{ {
Pen pen = new(Color.Black);
Brush lineBrush = new SolidBrush(Color.Gray);
// Гусеница // Гусеница
// Отрисовка танковых катков // Отрисовка танковых катков
Brush BrushBlack = new SolidBrush(Color.Black); Brush BrushRandom = new SolidBrush(Tank?.BodyColor ?? Color.Black);
g.FillEllipse(BrushBlack, _startPosX + 113, _startPosY + 41, 11, 11); g.FillRectangle(BrushRandom, 28 + _startPosX, 50 + _startPosY, 10, 3);
g.FillEllipse(BrushBlack, _startPosX + 13, _startPosY + 40, 11, 11); g.FillRectangle(BrushRandom, 53 + _startPosX, 50 + _startPosY, 10, 3);
g.FillRectangle(BrushRandom, 78 + _startPosX, 50 + _startPosY, 10, 3);
g.FillRectangle(BrushRandom, 103 + _startPosX, 50 + _startPosY, 10, 3);
} }
if (ArmoVehicle.Tower) if (ArmoVehicle.Tower)
{ {
Brush bodyBrush = new SolidBrush(ArmoVehicle.AdditionalColor);
// Орудие // Орудие
Brush bodyBrush = new SolidBrush(ArmoVehicle.AdditionalColor);
g.FillRectangle(bodyBrush, _startPosX + 111, _startPosY + 17, 70, 5); g.FillRectangle(bodyBrush, _startPosX + 111, _startPosY + 17, 70, 5);
// Зенитное орудие // Зенитное орудие