PIbd-21 Potapov N.S. LabWork01 #1
@ -150,21 +150,21 @@ namespace ProjectStormtrooper
|
||||
Brush brushBodyColor = new SolidBrush(EntityStormtrooper.BodyColor);
|
||||
Brush brushAdditionalColor = new SolidBrush(EntityStormtrooper.AdditionalColor);
|
||||
|
||||
// Ширина фюзеляжа
|
||||
int bodyWidth = _stormtrooperHeight / 9;
|
||||
// Высота фюзеляжа
|
||||
int bodyHeight = _stormtrooperHeight / 9;
|
||||
|
||||
// Рисуем бомбы
|
||||
if (EntityStormtrooper.Bombs)
|
||||
{
|
||||
Point[] pointsBombTail = {
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8 + bodyWidth * 3 - 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth / 2 - _stormtrooperHeight / 3 + bodyWidth / 2),
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8 + bodyWidth * 3 + 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth / 2 - _stormtrooperHeight / 3 + bodyWidth / 2 - 5),
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8 + bodyWidth * 3 + 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth / 2 - _stormtrooperHeight / 3 + bodyWidth / 2 + 5),
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8 + bodyWidth * 3 - 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth / 2 - _stormtrooperHeight / 3 + bodyWidth / 2)
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8 + bodyHeight * 3 - 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight / 2 - _stormtrooperHeight / 3 + bodyHeight / 2),
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8 + bodyHeight * 3 + 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight / 2 - _stormtrooperHeight / 3 + bodyHeight / 2 - 5),
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8 + bodyHeight * 3 + 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight / 2 - _stormtrooperHeight / 3 + bodyHeight / 2 + 5),
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8 + bodyHeight * 3 - 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight / 2 - _stormtrooperHeight / 3 + bodyHeight / 2)
|
||||
};
|
||||
|
||||
g.FillPolygon(brushAdditionalColor, pointsBombTail);
|
||||
@ -182,51 +182,51 @@ namespace ProjectStormtrooper
|
||||
|
||||
g.FillEllipse(brushAdditionalColor,
|
||||
_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth / 2 - _stormtrooperHeight / 3,
|
||||
bodyWidth * 3,
|
||||
bodyWidth);
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight / 2 - _stormtrooperHeight / 3,
|
||||
bodyHeight * 3,
|
||||
bodyHeight);
|
||||
g.DrawEllipse(penBlack,
|
||||
_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth / 2 - _stormtrooperHeight / 3,
|
||||
bodyWidth * 3,
|
||||
bodyWidth);
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight / 2 - _stormtrooperHeight / 3,
|
||||
bodyHeight * 3,
|
||||
bodyHeight);
|
||||
|
||||
g.FillEllipse(brushAdditionalColor,
|
||||
_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth / 2 + _stormtrooperHeight / 3,
|
||||
bodyWidth * 3,
|
||||
bodyWidth);
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight / 2 + _stormtrooperHeight / 3,
|
||||
bodyHeight * 3,
|
||||
bodyHeight);
|
||||
g.DrawEllipse(penBlack,
|
||||
_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 8,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth / 2 + _stormtrooperHeight / 3,
|
||||
bodyWidth * 3,
|
||||
bodyWidth);
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight / 2 + _stormtrooperHeight / 3,
|
||||
bodyHeight * 3,
|
||||
bodyHeight);
|
||||
}
|
||||
|
||||
// Рисуем ракеты
|
||||
if (EntityStormtrooper.Rockets)
|
||||
{
|
||||
int rocketWidth = bodyWidth * 4;
|
||||
int rocketHeight = bodyWidth / 2;
|
||||
int rocketWidth = bodyHeight * 4;
|
||||
int rocketHeight = bodyHeight / 2;
|
||||
|
||||
Brush brushRed = new SolidBrush(Color.Red);
|
||||
|
||||
Point[] pointsRocketCockPit = {
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 5 - rocketHeight,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth - bodyWidth / 2 + rocketHeight / 2),
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight - bodyHeight / 2 + rocketHeight / 2),
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth - bodyWidth / 2),
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight - bodyHeight / 2),
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth - bodyWidth / 2 + rocketHeight)
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight - bodyHeight / 2 + rocketHeight)
|
||||
};
|
||||
|
||||
Point[] pointsRocketTail = {
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 5 - rocketHeight + rocketWidth - 10,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth - bodyWidth / 2 + rocketHeight / 2),
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight - bodyHeight / 2 + rocketHeight / 2),
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 5 + rocketWidth,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth * 2 + rocketHeight / 2),
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight * 2 + rocketHeight / 2),
|
||||
new Point(_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 5 + rocketWidth,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth - bodyWidth / 2 + rocketHeight + bodyWidth / 2 - rocketHeight / 2)
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight - bodyHeight / 2 + rocketHeight + bodyHeight / 2 - rocketHeight / 2)
|
||||
};
|
||||
|
||||
g.FillPolygon(brushRed, pointsRocketCockPit);
|
||||
@ -257,23 +257,23 @@ namespace ProjectStormtrooper
|
||||
|
||||
g.FillRectangle(brushAdditionalColor,
|
||||
_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth - bodyWidth / 2,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight - bodyHeight / 2,
|
||||
rocketWidth,
|
||||
rocketHeight);
|
||||
g.DrawRectangle(penBlack,
|
||||
_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 5,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyWidth - bodyWidth / 2,
|
||||
_startPosY + _stormtrooperHeight / 2 - bodyHeight - bodyHeight / 2,
|
||||
rocketWidth,
|
||||
rocketHeight);
|
||||
|
||||
g.FillRectangle(brushAdditionalColor,
|
||||
_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 5,
|
||||
_startPosY + _stormtrooperHeight / 2 + bodyWidth / 2 + bodyWidth / 2,
|
||||
_startPosY + _stormtrooperHeight / 2 + bodyHeight / 2 + bodyHeight / 2,
|
||||
rocketWidth,
|
||||
rocketHeight);
|
||||
g.DrawRectangle(penBlack,
|
||||
_startPosX + _stormtrooperWidth / 2 - _stormtrooperWidth / 5,
|
||||
_startPosY + _stormtrooperHeight / 2 + bodyWidth / 2 + bodyWidth / 2,
|
||||
_startPosY + _stormtrooperHeight / 2 + bodyHeight / 2 + bodyHeight / 2,
|
||||
rocketWidth,
|
||||
rocketHeight);
|
||||
}
|
||||
@ -282,8 +282,8 @@ namespace ProjectStormtrooper
|
||||
|
||||
Point[] pointsCockPit = {
|
||||
new Point(_startPosX, _startPosY + _stormtrooperHeight / 2),
|
||||
new Point(_startPosX + _stormtrooperWidth / 8, _startPosY + _stormtrooperHeight / 2 - bodyWidth / 2),
|
||||
new Point(_startPosX + _stormtrooperWidth / 8, _startPosY + _stormtrooperHeight / 2 + bodyWidth / 2)
|
||||
new Point(_startPosX + _stormtrooperWidth / 8, _startPosY + _stormtrooperHeight / 2 - bodyHeight / 2),
|
||||
new Point(_startPosX + _stormtrooperWidth / 8, _startPosY + _stormtrooperHeight / 2 + bodyHeight / 2)
|
||||
};
|
||||
|
||||
g.FillPolygon(brushBlack, pointsCockPit);
|
||||
@ -316,8 +316,8 @@ namespace ProjectStormtrooper
|
||||
|
||||
// Рисуем фюзеляж
|
||||
|
||||
g.FillRectangle(brushBodyColor, _startPosX + _stormtrooperWidth / 8, _startPosY + _stormtrooperHeight / 2 - bodyWidth / 2, _stormtrooperWidth - _stormtrooperWidth / 8, bodyWidth);
|
||||
g.DrawRectangle(penBlack, _startPosX + _stormtrooperWidth / 8, _startPosY + _stormtrooperHeight / 2 - bodyWidth / 2, _stormtrooperWidth - _stormtrooperWidth / 8, bodyWidth);
|
||||
g.FillRectangle(brushBodyColor, _startPosX + _stormtrooperWidth / 8, _startPosY + _stormtrooperHeight / 2 - bodyHeight / 2, _stormtrooperWidth - _stormtrooperWidth / 8, bodyHeight);
|
||||
g.DrawRectangle(penBlack, _startPosX + _stormtrooperWidth / 8, _startPosY + _stormtrooperHeight / 2 - bodyHeight / 2, _stormtrooperWidth - _stormtrooperWidth / 8, bodyHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user