diff --git a/AirFighter/DrawingAircraft.cs b/AirFighter/DrawingAircraft.cs index 23b680c..97b7e5d 100644 --- a/AirFighter/DrawingAircraft.cs +++ b/AirFighter/DrawingAircraft.cs @@ -20,8 +20,8 @@ namespace AirFighter private int? _pictureWidth = null; private int? _pictureHeight = null; - protected readonly int _aircraftWidth = 124; - protected readonly int _aircraftHeight = 70; + protected readonly int _aircraftWidth = 100; + protected readonly int _aircraftHeight = 100; public void Init(int speed, float weight, Color bodyColor) { @@ -87,6 +87,43 @@ namespace AirFighter } } break; + case Direction.UpRight: + { + if (_startPosY - Plane.Step > 0 && _startPosX + _aircraftWidth + Plane.Step < _pictureWidth) + { + _startPosY -= Plane.Step; + _startPosX += Plane.Step; + } + } + break; + case Direction.UpLeft: + { + if (_startPosY - Plane.Step > 0 && _startPosX - Plane.Step > 0) + { + _startPosX -= Plane.Step; + _startPosY -= Plane.Step; + + } + } + break; + case Direction.DownRight: + { + if (_startPosY + _aircraftHeight + Plane.Step < _pictureHeight && _startPosX + _aircraftWidth + Plane.Step < _pictureWidth) + { + _startPosY += Plane.Step; + _startPosX += Plane.Step; + } + } + break; + case Direction.DownLeft: + { + if (_startPosY + _aircraftHeight + Plane.Step < _pictureHeight && _startPosX - Plane.Step > 0) + { + _startPosY += Plane.Step; + _startPosX -= Plane.Step; + } + } + break; } } @@ -175,9 +212,6 @@ namespace AirFighter - - - } public void ChangeBorders(int width, int height)