|
@@ -119,7 +119,7 @@ public class HolonCanvas extends JPanel implements MouseWheelListener {
|
|
|
bodies.get(j).setRadius(subnets.get(i).getObjects().size() * 5 + 10);
|
|
|
bodies.get(j).setMass(subnets.get(i).getObjects().size() * 5 + 10);
|
|
|
newBodies.add(bodies.get(j));
|
|
|
- newBodies.get(newBodies.size()-1).setId(newBodies.size()-1);
|
|
|
+ newBodies.get(i).setId(i);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -148,12 +148,7 @@ public class HolonCanvas extends JPanel implements MouseWheelListener {
|
|
|
}
|
|
|
|
|
|
public void render(Graphics g) {
|
|
|
- // System.out.printf("Width: %d Height: %d\n", getWidth(), getHeight());
|
|
|
-
|
|
|
- // Create BufferStrategy for rendering/drawing
|
|
|
this.g2 = (Graphics2D) g;
|
|
|
-
|
|
|
- // Turn on anti-aliasing
|
|
|
this.g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
|
|
|
|
|
// Render Background
|
|
@@ -162,7 +157,6 @@ public class HolonCanvas extends JPanel implements MouseWheelListener {
|
|
|
|
|
|
// Render Game Objects
|
|
|
for (int i = 0; i < subCount; i++) {
|
|
|
- bodies.get(i).setRadius((subnets.get(i).getObjects().size() * 5 + 10)*controller.getHolonBodyScale()/100);
|
|
|
bodies.get(i).draw(this.g2);
|
|
|
}
|
|
|
}
|