Исправления

This commit is contained in:
prodigygirl 2022-10-22 20:40:30 +04:00
parent 9bf470f992
commit bcca5be3f1
2 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ public class DrawingArmoredCar {
this.armoredCar.init(speed, weight, bodyColor);
Random r = new Random();
this.drawingCaterpillar = new DrawingCaterpillar();
this.drawingCaterpillar.Init(r.nextInt(4) + 3, bodyColor);
this.drawingCaterpillar.Init(r.nextInt(4, 7), bodyColor);
}
public void SetPosition(int x, int y, int width, int height) {

View File

@ -43,15 +43,15 @@ public class FormCar extends JFrame{
public void actionPerformed(ActionEvent actionEvent) {
Random rnd = new Random();
armoredCar = new DrawingArmoredCar();
armoredCar.Init(rnd.nextInt(200) + 100, rnd.nextInt(1000) + 1000,
armoredCar.Init(rnd.nextInt(100,300), rnd.nextInt(1000, 2000),
new Color(rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256)));
armoredCar.SetPosition(rnd.nextInt(90) + 10, rnd.nextInt(90) + 10,
armoredCar.SetPosition(rnd.nextInt(10, 100), rnd.nextInt(10, 100),
drawPanel.getWidth(), drawPanel.getHeight());
labelSpeed.setText("Скорость: " + armoredCar.getArmoredCar().getSpeed());
labelWeight.setText("Вес: " + armoredCar.getArmoredCar().getWeight());
labelColor.setText("Цвет: " + armoredCar.getArmoredCar().getWeight());
labelColor.setText("Цвет: " + armoredCar.getArmoredCar().getBodyColor().getRGB());
}
});