обн
This commit is contained in:
parent
3f2e056315
commit
09aba1c075
@ -23,17 +23,17 @@ namespace AirBomber
|
||||
|
||||
private int _PlaneHeight = 185;
|
||||
|
||||
public bool Init(int speed, int weight, Color bodycolor, Color dopcolor, bool bodykit, bool toplivo, bool rocket, int width, int height)
|
||||
public bool Init(int speed, int weight, Color bodycolor, Color dopcolor, bool toplivo, bool rocket, int width, int height)
|
||||
{
|
||||
//TODO: Продумать проверки
|
||||
if (weight < _pictureWeigth || height < _pictureHeight)
|
||||
if (width < _pictureWeigth || height < _pictureHeight)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_pictureWeigth = width;
|
||||
_pictureHeight = height;
|
||||
EntityAirBomber = new EntityAirBomber();
|
||||
EntityAirBomber.Init(speed, weight, bodycolor, dopcolor, bodykit, toplivo, rocket);
|
||||
EntityAirBomber.Init(speed, weight, bodycolor, dopcolor, toplivo, rocket);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ namespace AirBomber
|
||||
|
||||
Pen pen = new(Color.Black);
|
||||
Brush dopcolor = new SolidBrush(EntityAirBomber.DopColor);
|
||||
if (EntityAirBomber.BodyKit)
|
||||
if (EntityAirBomber.Toplivo)
|
||||
{
|
||||
//отрисовка ракет
|
||||
GraphicsPath rocket_1 = new GraphicsPath();
|
||||
@ -139,6 +139,8 @@ namespace AirBomber
|
||||
rocket_4.CloseFigure();
|
||||
g.FillPath(dopcolor, rocket_4);
|
||||
g.DrawPath(Pens.Black, rocket_4);
|
||||
}
|
||||
if (EntityAirBomber.Rocket) {
|
||||
//отрисовка баков
|
||||
g.FillRectangle(dopcolor, _startPosX + 82, _startPosY + 5, 8, 10);
|
||||
g.FillRectangle(dopcolor, _startPosX + 82, _startPosY + 25, 8, 10);
|
||||
|
@ -16,21 +16,18 @@ namespace AirBomber
|
||||
|
||||
public Color DopColor { get; private set; } // доп цвет
|
||||
|
||||
public bool BodyKit { get; private set; } //наличие обвесов
|
||||
|
||||
public bool Toplivo { get; private set; } // топливо
|
||||
|
||||
public bool Rocket { get; private set; } //ракеты
|
||||
|
||||
public double Step => (double)Speed * 100 / Weight;
|
||||
|
||||
public void Init(int speed, int weight, Color bodycolor, Color dopcolor, bool bodykit, bool toplivo, bool ropcket)
|
||||
public void Init(int speed, int weight, Color bodycolor, Color dopcolor, bool toplivo, bool ropcket)
|
||||
{
|
||||
Speed = speed;
|
||||
Weight = weight;
|
||||
BodyColor = bodycolor;
|
||||
DopColor = dopcolor;
|
||||
BodyKit = bodykit;
|
||||
Toplivo = toplivo;
|
||||
Rocket = ropcket;
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ namespace AirBomber
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
||||
Convert.ToBoolean(random.Next(0, 2)),
|
||||
Convert.ToBoolean(random.Next(0, 2)),
|
||||
Convert.ToBoolean(random.Next(0, 2)),
|
||||
pictureBox.Width, pictureBox.Height);
|
||||
_drawingair.SetPosition(random.Next(10, 100),
|
||||
random.Next(10, 100));
|
||||
|
Loading…
x
Reference in New Issue
Block a user