Code for these debug graphics:
/*
* g - Graphics2D object provided in onPaint(Graphics2D) (or from bot.getGraphics() in 1.6.1 +)
* bot - reference to my instance of AdvancedRobot
* w - wave.
* w.ctime - when the wave was fired
*/
if (bot.getOthers() == 1) {
g.setColor(new Color(0f, 0.5f, 0f));
g.draw(new Ellipse2D.Double(goal.x - 10, goal.y - 10, 20, 20));
double radius, arcSegment, segmentHeading;
double time = bot.getTime();
for (Wave w : waves) {
radius = (time - w.ctime) * w.speed;
arcSegment = w.extent / NUM_WAVEBUCKETS;
segmentHeading = 0;
for (int i = 0; i < NUM_WAVEBUCKETS; i++) {
g.setColor(Color.getHSBColor(
(w.reachableBucket == i ? 0f : 1/3f), // green, or red if it's the target bucket
1f, // full saturation of course
(float)(0.25 + 0.75 * waveBuckets[i] / bucketMax) // brighter as the bucket is fuller
));
//g.setStroke(new BasicStroke((float)(4 * waveBuckets[i] / bucketMax))); // disabled due to CPU expense
//draw a line for each bucket along the arc of the wave
segmentHeading = w.heading - w.clockwise * (w.extent / 2 - arcSegment * (i - 0.5));
g.draw(new Line2D.Double(
w.origin.x + radius * Math.sin(segmentHeading),
w.origin.y + radius * Math.cos(segmentHeading),
w.origin.x + radius * Math.sin(segmentHeading + arcSegment),
w.origin.y + radius * Math.cos(segmentHeading + arcSegment)
));
}
}
}