大神帮忙看看为什么不显示……
processing吧
全部回复
仅看楼主
level 1
sunnytdz 楼主
void setup() {
size(screen.width, screen.height);
b1 = new Ball(50,50);
ArrayList<Ball> balls = new ArrayList<Ball>();
balls.add(new Ball(150,150));
}
void draw() {
background(225);
fill(0);
for (i = 1; i< balls.size(); ++i) {
ball = balls.get(i);
ball.draw();
}
}
class Ball {
float x,y;
Ball(float x, float y) {
this.x = x;
this.y = y;
}
void draw() {
ellipse(x,y,40,40)
}
}
2018年08月14日 11点08分 1
1