非法字符错误:“\u200b”
2022-09-01 11:18:16
我正在面向对象编程类中为小行星游戏制作小行星场,但我收到一个非法字符错误:“\u200b”。这个问题似乎发生在第12行。(import java.awt.Point; 和公共类 Asteroid 之间的线扩展了 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);
}
}