I was getting "Uncompilable source code - Erroneous tree type" error and "cannot find symbol" error I turned off compile on save and now get cannot find symbol. The area that seems to be breaking it is where I initialize Asteroid() in AsteroidFields generate method, so I feel like my initialization is incorrect but I haven't been able to figure out how.
package asteroidfield;
import java.util.TreeSet;
import blobzx.BlobGUI;
import blobzx.SandBox;
import blobzx.SandBoxMode;
public class AsteroidField implements BlobGUI {
SandBox ast;
public static void main (String [] Args){
new AsteroidField();
}
public AsteroidField (){
ast = new SandBox();
ast.setSandBoxMode(SandBoxMode.FLOW);
ast.setFrameRate(15);
ast.init(this);
}
@Override
public void generate() {
// This is the line that is breaking the code.
Asteroid asteroid = new Asteroid();
}
}
package AsteroidField;
import blobzx.BlobUtils;
import blobzx.PolyBlob;
import java.awt.Point;
import java.util.Random;
public class Asteroid extends PolyBlob{
// private static Random random = new Random();
public Asteroid(int velX, int velY, double rot) {
super(-100, -100, rot);
setDelta(velX, velY);
Random sides = new Random();
Random dist = new Random();
int si = sides.nextInt(9 - 5 + 1) + 5;
int di = dist.nextInt(15 - 5 + 1) + 5;
double region = (2 * Math.PI) / si;
double []angle = new double [si];
int [] xInt = new int[si];
int [] yInt = new int[si];
double [] x = new double [si];
double [] y = new double [si];
System.out.print("m");
for(int i = 0; i < si; i++){
angle[i] = (i*region)+(Math.random()*region);
Point cord = BlobUtils.rotatePoint(di, angle[i]);
x[i] = cord.getX();
y[i] = cord.getY();
}
for (int i = 0; i > x.length; i ++){
xInt[i] = (int) x[i];
yInt[i] = (int) y[i];
}
setPolygon(xInt, yInt);
}
}