problem with arc and key arrows
in
Programming Questions
•
11 months ago
hi i am new in procesing
I'm trying to do a very simple program with an arc
the arc is basically increase and decrease with the arrow keys
the problem is
when I click play the arc increases and you can see it increasing
but there is no decrease in the image
float x1= 270.0;
void setup() {
size(480, 420);
}
void draw() {
if (keyPressed && (key == CODED)) { // If it’s a coded key
if (keyCode == LEFT) { // If it’s the left arrow
x1--;
} else if (keyCode == RIGHT) { // If it’s the right arrow
x1++;
}
}
println(x1);
fill(102);
smooth();
arc(190, 60, 80, 80, radians(x1), TWO_PI);
}
I'm trying to do a very simple program with an arc
the arc is basically increase and decrease with the arrow keys
the problem is
when I click play the arc increases and you can see it increasing
but there is no decrease in the image
float x1= 270.0;
void setup() {
size(480, 420);
}
void draw() {
if (keyPressed && (key == CODED)) { // If it’s a coded key
if (keyCode == LEFT) { // If it’s the left arrow
x1--;
} else if (keyCode == RIGHT) { // If it’s the right arrow
x1++;
}
}
println(x1);
fill(102);
smooth();
arc(190, 60, 80, 80, radians(x1), TWO_PI);
}
1