Compare commits
2 Commits
346581751d
...
master
Author | SHA1 | Date | |
---|---|---|---|
7a128c3d23 | |||
|
7ea460dab0 |
@ -17,7 +17,8 @@ public class DrawingArtillery {
|
||||
public void Init(int speed, float weight, Color bodyColor, int rollersCount) {
|
||||
artillery = new EntityArtillery();
|
||||
artillery.Init(speed, weight, bodyColor);
|
||||
drawingRollers = new DrawingRollers(rollersCount, bodyColor);
|
||||
drawingRollers = new DrawingRollers();
|
||||
drawingRollers.Init(rollersCount, bodyColor);
|
||||
}
|
||||
|
||||
public void SetPosition(int x, int y, int width, int height) {
|
||||
|
@ -4,9 +4,9 @@ public class DrawingRollers {
|
||||
private RollersCount rollersCount;
|
||||
private Color color;
|
||||
|
||||
public DrawingRollers(int rollersCount, Color rollersColor) {
|
||||
public void Init(int rollersCount, Color bodyColor) {
|
||||
setRollersCount(rollersCount);
|
||||
color = rollersColor;
|
||||
color = bodyColor;
|
||||
}
|
||||
|
||||
public void setRollersCount(int num) {
|
||||
|
@ -42,7 +42,7 @@ public class FormArtillery extends JFrame {
|
||||
pictureBox.addComponentListener(new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
if (_artillery != null) _artillery.changeBorders(e.getComponent().getWidth(), e.getComponent().getHeight());
|
||||
if (_artillery != null) _artillery.changeBorders(pictureBox.getWidth(), pictureBox.getHeight());
|
||||
repaint();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user