Bondarenko M.S. Lab Work 1 #1
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user