NOOB: something simple
in
Programming Questions
•
2 years ago
hi, how do i make ellipse in this code to start shrinking-expanding-shrinking-expanding
not like right now expanding-shrinking...etc.
float x=0;
void setup(){
size(200,200);
smooth();
}
void draw(){
background(127);
x=x+1;
if (x>width){
x=-x;
}
ellipse(width/2,height/2,x,x);
}
//my attempt (fails)
float x=200;
void setup(){
size(200,200);
smooth();
}
void draw(){
background(127);
x=x-1;
if (x<0){
x=+x;
}
if (x>width){
x=x+1;
}
ellipse(width/2,height/2,x,x);
}
not like right now expanding-shrinking...etc.
float x=0;
void setup(){
size(200,200);
smooth();
}
void draw(){
background(127);
x=x+1;
if (x>width){
x=-x;
}
ellipse(width/2,height/2,x,x);
}
//my attempt (fails)
float x=200;
void setup(){
size(200,200);
smooth();
}
void draw(){
background(127);
x=x-1;
if (x<0){
x=+x;
}
if (x>width){
x=x+1;
}
ellipse(width/2,height/2,x,x);
}
1