xxxxxxxxxx
color color1 = color(255, 0, 0);
color color2 = color(9, 2, 79);
color barColor = color1;
ArrayList<Deez> JAMAL = new ArrayList();
float sync = 1000, delay = 250;
int K = 0, D = 1;
void setup() {
size(500,500,P3D);
}
void draw() {
if (millis() > sync) {
JAMAL.add(new Deez());
sync = millis() + delay;
}
background(0);
translate(width/2, height, 0);
fill(barColor);
box(250,150,100);
for(Deez eachDeez: JAMAL) {
eachDeez.moveAndRender();
}
for(Deez eachDeez: JAMAL) {
if (eachDeez.yPos > -95) {
JAMAL.remove(eachDeez);
if (barColor == eachDeez.myColor)
K +=1;
else
D -=1;
if (D <= 0) exit();
}
}
textSize(50);
textAlign(CENTER,CENTER);
fill(random(0,256), random(0,0), random(0,0));
text("K/D: " + K + " - D: " + D, -100, -500, 0);
}
void mouseClicked() {
if (barColor == color1) {
barColor = color2;
} else {
barColor = color1;
}
}