我收到“无法编译的源代码 - 错误的树类型”错误和“找不到符号”错误我关闭了保存时编译,现在找不到符号。似乎破坏它的区域是我在 AsteroidFields 生成方法中初始化 Asteroid() 的地方,所以我觉得我的初始化不正确,但我无法弄清楚如何实现。
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 …
Run Code Online (Sandbox Code Playgroud) java ×1