Доработка второй стратегии, чистка
This commit is contained in:
parent
c11d4126a5
commit
fd17593df5
@ -22,7 +22,7 @@ namespace AirBomber
|
|||||||
/// <param name="width">Ширина картинки</param>
|
/// <param name="width">Ширина картинки</param>
|
||||||
/// <param name="height">Высота картинки</param>
|
/// <param name="height">Высота картинки</param>
|
||||||
public DrawningAirBomber(int speed, double weight, Color bodyColor, Color
|
public DrawningAirBomber(int speed, double weight, Color bodyColor, Color
|
||||||
additionalColor, bool bombs, Color bombsColor, bool fuelTanks, int width, int height) :
|
additionalColor, bool bombs, Color bombsColor, bool fuelTanks, int width, int height) :
|
||||||
|
|
||||||
base(speed, weight, bodyColor, width, height, 160, 118)
|
base(speed, weight, bodyColor, width, height, 160, 118)
|
||||||
{
|
{
|
||||||
@ -42,14 +42,12 @@ namespace AirBomber
|
|||||||
Brush bombsColor = new SolidBrush(airBomber.BombsColor);
|
Brush bombsColor = new SolidBrush(airBomber.BombsColor);
|
||||||
base.DrawPlane(g);
|
base.DrawPlane(g);
|
||||||
// обвесы
|
// обвесы
|
||||||
|
|
||||||
g.FillEllipse(bombsColor, _startPosX + 90, _startPosY + 20, 15, 29);
|
g.FillEllipse(bombsColor, _startPosX + 90, _startPosY + 20, 15, 29);
|
||||||
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 20, 15, 29);
|
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 20, 15, 29);
|
||||||
g.FillEllipse(bombsColor, _startPosX + 90, _startPosY + 70, 15, 29);
|
g.FillEllipse(bombsColor, _startPosX + 90, _startPosY + 70, 15, 29);
|
||||||
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 70, 15, 29);
|
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 70, 15, 29);
|
||||||
g.FillEllipse(bombsColor, _startPosX + 140, _startPosY + 50, 15, 15);
|
g.FillEllipse(bombsColor, _startPosX + 140, _startPosY + 50, 15, 15);
|
||||||
g.DrawEllipse(pen, _startPosX + 140, _startPosY + 50, 15, 15);
|
g.DrawEllipse(pen, _startPosX + 140, _startPosY + 50, 15, 15);
|
||||||
|
|
||||||
// fueltanks
|
// fueltanks
|
||||||
g.FillRectangle(additionalBrush, _startPosX + 63, _startPosY + 34, 20, 15);
|
g.FillRectangle(additionalBrush, _startPosX + 63, _startPosY + 34, 20, 15);
|
||||||
g.DrawRectangle(pen, _startPosX + 63, _startPosY + 34, 20, 15);
|
g.DrawRectangle(pen, _startPosX + 63, _startPosY + 34, 20, 15);
|
||||||
|
@ -227,7 +227,7 @@ namespace AirBomber
|
|||||||
// вправо
|
// вправо
|
||||||
DirectionType.Right => _startPosX + EntityAirPlane.Step + _airPlaneWidth < _pictureWidth,
|
DirectionType.Right => _startPosX + EntityAirPlane.Step + _airPlaneWidth < _pictureWidth,
|
||||||
//вниз
|
//вниз
|
||||||
DirectionType.Down => _startPosY + EntityAirPlane.Step + _airPlaneHeight< _pictureHeight,
|
DirectionType.Down => _startPosY + EntityAirPlane.Step + _airPlaneHeight < _pictureHeight,
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ namespace AirBomber
|
|||||||
var objParams = GetObjectParameters;
|
var objParams = GetObjectParameters;
|
||||||
if (objParams == null) return;
|
if (objParams == null) return;
|
||||||
if (objParams.RightBorder < FieldWidth - GetStep()) MoveRight();
|
if (objParams.RightBorder < FieldWidth - GetStep()) MoveRight();
|
||||||
|
if (objParams.DownBorder < FieldHeight - GetStep()) MoveDown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user