double x, y;
AffineTransform at;
int battleFieldHeight = battleField.getHeight();
if (drawGround && drawExplosionDebris) {
RenderImage explodeDebrise = imageManager.getExplosionDebriseRenderImage();
for (IRobotSnapshot robotSnapshot : snapShot.getRobots()) {
if (robotSnapshot.getState().isDead()) {
x = robotSnapshot.getX();
y = battleFieldHeight - robotSnapshot.getY();
at = AffineTransform.getTranslateInstance(x, y);
explodeDebrise.setTransform(at);
explodeDebrise.paint(g);
}
}
}
for (IRobotSnapshot robotSnapshot : snapShot.getRobots()) {
if (robotSnapshot.getState().isAlive()) {
x = robotSnapshot.getX();
y = battleFieldHeight - robotSnapshot.getY();
at = AffineTransform.getTranslateInstance(x, y);
at.rotate(robotSnapshot.getBodyHeading());
RenderImage robotRenderImage = imageManager.getColoredBodyRenderImage(robotSnapshot.getBodyColor());
robotRenderImage.setTransform(at);
robotRenderImage.paint(g);
at = AffineTransform.getTranslateInstance(x, y);
at.rotate(robotSnapshot.getGunHeading());
RenderImage gunRenderImage = imageManager.getColoredGunRenderImage(robotSnapshot.getGunColor());
gunRenderImage.setTransform(at);
gunRenderImage.paint(g);
if (!robotSnapshot.isDroid()) {
at = AffineTransform.getTranslateInstance(x, y);
at.rotate(robotSnapshot.getRadarHeading());
RenderImage radarRenderImage = imageManager.getColoredRadarRenderImage(robotSnapshot.getRadarColor());
radarRenderImage.setTransform(at);
radarRenderImage.paint(g);
}
}
}
}