求助
processing吧
全部回复
仅看楼主
level 1
王有疾º 楼主
做小球运动,现在显示是这个错误,不清楚是什么情况,求大佬告知,感谢
2020年12月28日 02点12分 1
level 1
王有疾º 楼主
int x = 200;
int y = 200;
int r = 150;
int c = 0;
void setup()
{
size(600, 600);
colorMode(HSB, 360, 100, 100);
}
fill(c, 100, 100);
ellipse(x, y, r, r);
if (x >= (600-r/2))
{
if (state == 0)
r += 50;//变大,下同。
else
r -= 50;
a = -a;
c -= 50;
if (c < 0)
c += 360;
x = 600-r/2;
}
if (x <= (r/2))
{
if (state == 0)
r += 50;
else
r -= 50;
a = -a;
c -= 50;
if (c < 0)
c += 360;
x = (r/2);
}
if (y >= (600-r/2))
{
if (state == 0)
r += 50;
else
r -= 50;
b = -b;
c -= 50;
if (c < 0)
c += 360;
y = (600-r/2);
}
if (y <= (r/2))
{
if (state == 0)
r += 50;
else
r -= 50;
b = -b;
c -= 50;
if (c < 0)
c += 360;
y = (r/2);
}
if (r >= 250)
state = 1;
if (r <= 50)
state = 0;
2020年12月28日 03点12分 2
level 1
你没有写void draw()啊?
2021年01月02日 19点01分 3
1