我正在我的面向对象编程课程中为小行星游戏制作小行星场,我收到一个非法字符错误:'\u200b'。问题似乎发生在第 12 行。(import java.awt.Point; 和 public class Asteroid extends PolyBlob 之间的线)
/*
* University of Central Florida
* COP3330 - Spring 2016
* Author: Aundray Ortiz
*/
package asteroidfield;
import java.util.Random;
import blobzx.PolyBlob;
import blobzx.BlobUtils;
import java.awt.Point;
public class Asteroid extends PolyBlob
{
private static final Random random = new Random();
public Asteroid(int a, int b, double c)
{
super(-100,-100,c);
int sides = 5 + random.nextInt(5);
int[] x = new int[sides];
int[] y = new int[sides];
int going = 0;
double direct = 0;
double region = (Math.PI * 2)/sides;
for(int num = 0; num<sides;num++)
{
going = 5 + random.nextInt(16);
direct = (num * region) + (Math.random() * region);
Point p = BlobUtils.rotatePoint(going, direct);
x[num] = p.x;
y[num] = p.y;
}
setPolygon(x, y);
setRate(c);
setDelta(a,b);
}
}