Bondarenko M.S. Lab Work 1 #1

Merged
eegov merged 5 commits from LabWork_01 into master 2022-10-07 09:24:25 +04:00
Showing only changes of commit 993e92ab6c - Show all commits

View File

@ -24,8 +24,9 @@ namespace WarmlyShip
public void SetPosition(int x, int y, int width, int height)
{
_startPosX = x;
_startPosY = y;
Random random = new Random();
_startPosX = x < 0 || x > width ? random.Next(0, width) : x;
_startPosY = y < 0 || y > height ? random.Next(0, height) : y;
_pictureWidth = width;
_pictureHeight = height;
}