xxxxxxxxxx
void setup (){
size (540, 540);
noStroke();
smooth();
background(0);
frameRate(60);
//noLoop();
}
float a = 0;
float c = 0;
float e = 0;
float g = 0;
void draw(){
background(0);
strokeWeight(10);
stroke(255,0,0);
line(400,0,400,height);
noStroke();
target(a,60);
a = a + random(0,10);
target(c, 180);
c = c + random(0,10);
target(e, 300);
e = e + random(0,10);
target(g, 420);
g = g + random(0,10);
if(a >= 400){
noLoop();
text("a WINS", width/2,height/2);
}
if(c >= 400){
noLoop();
text("c WINS", width/2,height/2);
}
if(e >= 400){
noLoop();
text("e WINS", width/2,height/2);
}
if(g >= 400){
noLoop();
text("g WINS", width/2,height/2);
}
}
void keyPressed(){
noLoop();
}
void keyReleased(){
loop();
}
void target(float x, float y){
fill(255, 0, 0);
arc(x, y, 60, 60, PI, TWO_PI);
fill(255);
ellipse(x - 20, y + 5, 30,30);
ellipse(x + 20, y + 5, 30,30);
}