@2x size images.

ComboBurst speed scaling.

CircumscribedCircle drawing optimization.
This commit is contained in:
fd
2015-03-14 08:11:33 -04:00
parent 356772b6b6
commit aeaaa9af4f
6 changed files with 125 additions and 82 deletions

View File

@@ -55,6 +55,9 @@ public class CircumscribedCircle extends Curve {
/** The number of steps in the curve to draw. */
private float step;
/** Points along the curve. */
private Vec2f[] curve;
/**
* Constructor.
@@ -120,6 +123,12 @@ public class CircumscribedCircle extends Curve {
// finds the angles to draw for repeats
this.drawEndAngle = (float) ((endAng + (startAng > endAng ? HALF_PI : -HALF_PI)) * 180 / Math.PI);
this.drawStartAngle = (float) ((startAng + (startAng > endAng ? -HALF_PI : HALF_PI)) * 180 / Math.PI);
curve = new Vec2f[(int) step + 1];
for (int i = 0; i < curve.length; i++) {
float[] xy = pointAt(i / step);
curve[i] = new Vec2f(xy[0], xy[1]);
}
}
/**
@@ -172,13 +181,11 @@ public class CircumscribedCircle extends Curve {
public void draw() {
Image hitCircle = GameImage.HITCIRCLE.getImage();
Image hitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage();
float[][] xy = new float[(int) step + 1][];
for (int i = 0; i < step; i++) {
xy[i] = pointAt(i / step);
hitCircleOverlay.drawCentered(xy[i][0], xy[i][1], Utils.COLOR_WHITE_FADE);
hitCircleOverlay.drawCentered(curve[i].x, curve[i].y, Utils.COLOR_WHITE_FADE);
}
for (int i = 0; i < step; i++)
hitCircle.drawCentered(xy[i][0], xy[i][1], color);
hitCircle.drawCentered(curve[i].x, curve[i].y, color);
}
@Override