ISEbd-12_Rozhkov.I.E._Simple #1

Closed
RozhVan wants to merge 2 commits from lab01 into main
2 changed files with 6 additions and 3 deletions
Showing only changes of commit 283b167e75 - Show all commits

View File

@ -107,19 +107,22 @@ public class DrawCont
return true;
case DirectionType.Right:
if (_StartPosX.Value + EntityContainer.Step < _PictureWidth)
if (_StartPosX.Value + EntityContainer.Step < _PictureWidth - _drawingContWidth)
{
_StartPosX += (int)EntityContainer.Step;
}
return true;
case DirectionType.Up:
if (_StartPosY.Value - EntityContainer.Step > 0)
{
_StartPosY -= (int)EntityContainer.Step;
}
return true;
case DirectionType.Down:
if (_StartPosY.Value + EntityContainer.Step < _PictureHeight)
if (_StartPosY.Value + EntityContainer.Step < _PictureHeight - _drawingContHeight)
{
_StartPosY += (int)EntityContainer.Step;
}

View File

@ -34,7 +34,7 @@ public class EntityContainer
/// </summary>
public bool Crane { get; private set; }
public double Step => Speed * 100 / Weight;
public double Step => Speed * 10 / Weight;
public void Init(int speed, double weight, Color shipColor, Color containerColor, bool container, bool crane)
{