| Conditions | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package example.swing; |
||
| 12 | public Ball(DrawingPanel panel) { |
||
| 13 | double heading = Math.random() * Math.PI * 2; |
||
| 14 | dx = Math.cos(heading); |
||
| 15 | dy = Math.sin(heading); |
||
| 16 | |||
| 17 | ball = new Ellipse( |
||
| 18 | Math.random() * panel.getWidth(), |
||
| 19 | Math.random() * panel.getHeight(), |
||
| 20 | 20, 20, |
||
| 21 | panel |
||
| 22 | ); |
||
| 23 | ball.setFillColor(new Color((float) Math.random(), (float) Math.random(), (float) Math.random())); |
||
| 24 | ball.setStrokeColor(ball.getFillColor()); |
||
| 25 | } |
||
| 37 |