Правка
This commit is contained in:
parent
f0e50f2758
commit
6eb0ae0dc9
@ -45,9 +45,10 @@ namespace AirFighter
|
||||
/// <param name="speed">Скорость</param>
|
||||
/// <param name="weight">Вес самолета</param>
|
||||
/// <param name="bodyColor">Цвет кузова</param>
|
||||
public void Init(EntityAirFighter _entityAirFighter)
|
||||
public void Init(int speed, float weight, Color bodyColor)
|
||||
{
|
||||
AirFighter = _entityAirFighter;
|
||||
AirFighter = new EntityAirFighter();
|
||||
AirFighter.Init(speed, weight, bodyColor);
|
||||
}
|
||||
/// <summary>
|
||||
/// Установка позиции самолета
|
||||
|
@ -26,9 +26,7 @@ namespace AirFighter
|
||||
{
|
||||
_airFighter = new DrawningAirFighter();
|
||||
Random rnd = new Random();
|
||||
EntityAirFighter entityAirFighter = new EntityAirFighter();
|
||||
entityAirFighter?.Init(rnd.Next(200, 500), rnd.Next(2000, 5000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
|
||||
_airFighter.Init(entityAirFighter);
|
||||
_airFighter.Init(rnd.Next(200, 500), rnd.Next(2000, 5000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
|
||||
_airFighter.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBoxAirFighter.Width, pictureBoxAirFighter.Height);
|
||||
toolStripStatusLabelSpeed.Text = $"Ñêîðîñòü: {_airFighter.AirFighter?.Speed}";
|
||||
toolStripStatusLabelWeight.Text = $"Âåñ: {_airFighter.AirFighter?.Weight}";
|
||||
|
Loading…
Reference in New Issue
Block a user