diff --git a/src/main/java/DrawingArmoredCar.java b/src/main/java/DrawingArmoredCar.java index a3bd38b..6b0fe3f 100644 --- a/src/main/java/DrawingArmoredCar.java +++ b/src/main/java/DrawingArmoredCar.java @@ -12,9 +12,9 @@ public class DrawingArmoredCar { private int pictureHeight; - private static final int carWidth = 80; + private int carWidth = 80; - private static final int carHeight = 50; + private int carHeight = 50; private DrawingCaterpillar drawingCaterpillar; @@ -29,6 +29,12 @@ public class DrawingArmoredCar { this.drawingCaterpillar.Init(r.nextInt(4, 7), bodyColor); } + protected DrawingArmoredCar(int speed, float weight, Color bodyColor, int carWidth, int carHeight) { + this(speed, weight, bodyColor); + this.carWidth = carWidth; + this.carHeight = carHeight; + } + public void SetPosition(int x, int y, int width, int height) { if (x >= 0 && y >= 0 && x + carWidth < width && y + carHeight < height) { startPosX = x;