Исправления
This commit is contained in:
parent
9bf470f992
commit
bcca5be3f1
@ -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) {
|
||||
|
@ -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());
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user