void setup(){
size(400,400);
}
void draw(){
/*can I merge these so that I only need to adjust one x and y value?*/
ellipse(200,200,100,100);
ellipse(170,170,50,50);
ellipse(220,220,50,50);
if(key=='w'){
y--;
}
}
你好,我是处理技术的新手,正在尝试找到一种合并多个形状的方法,因此,我不需要一一调整每个值。我已经看到了PShape函数,但似乎无法使用它来调整形状的x和y值。
您正在寻找这样的东西吗?
int x = 170;
int y = 200;
void setup() {
size(400,400);
}
void draw() {
/*can I merge these so that I only need to adjust one x and y value?*/
ellipse(x+30,y+30,100,100);
ellipse(x,y,50,50);
ellipse(x+50,y+50,50,50);
if(keyPressed && key=='w'){
y--;
}
}