CPIBvu-11 KhairullinA.N. LabWork02 Simple #2

Closed
KhairullinAN wants to merge 6 commits from LabWork02 into main
Showing only changes of commit 2238e92799 - Show all commits

View File

@ -133,13 +133,13 @@ public class DrawningCruiser
}
return true;
case DirectionType.Right:
if (_startPosX.Value - EntityCruiser.Step > 0)
if (_startPosX.Value + _drawningCruiserWidth + EntityCruiser.Step < _pictureWidth)
{
_startPosX += (int)EntityCruiser.Step;
}
return true;
case DirectionType.Down:
if (_startPosY.Value - EntityCruiser.Step > 0)
if (_startPosY.Value + _drawingCruiserHeight + EntityCruiser.Step < _pictureHeight)
{
_startPosY += (int)EntityCruiser.Step;
}