diff --git a/AircraftCarrier/AircraftCarrier/DrawingWarship.cs b/AircraftCarrier/AircraftCarrier/DrawingWarship.cs index d1ba1a3..6053857 100644 --- a/AircraftCarrier/AircraftCarrier/DrawingWarship.cs +++ b/AircraftCarrier/AircraftCarrier/DrawingWarship.cs @@ -65,8 +65,7 @@ namespace AircraftCarrier _startPosY = y; _pictureWidth = width; _pictureHeight = height; - } - else return; + } } /// /// Изменение направления пермещения diff --git a/AircraftCarrier/AircraftCarrier/FormWarship.cs b/AircraftCarrier/AircraftCarrier/FormWarship.cs index 3866bc7..2e6b037 100644 --- a/AircraftCarrier/AircraftCarrier/FormWarship.cs +++ b/AircraftCarrier/AircraftCarrier/FormWarship.cs @@ -23,7 +23,7 @@ namespace AircraftCarrier /// /// private void ButtonCreate_Click(object sender, EventArgs e) - { + { Random rnd = new(); _warship = new DrawingWarship(); _warship.Init(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));