ArrayList < Pipe > pipeline = new ArrayList();
float nextPipe, pipeDelay = 5000;
bird = requestImage("bird.png");
birdup = requestImage("birdup.png");
birddown = requestImage("birddown.png");
pipeImg = requestImage("pipe.png");
background(81, 201, 252);
if (millis() > nextPipe) {
pipeline.add(new Pipe());
nextPipe = millis() + pipeDelay;
for (Pipe pipe: pipeline) {
textAlign(CENTER, CENTER);
text("Score: " + str(score), width/2, 32)
rect(width / 2, height / 2, width / 1.5, height / 2, 15);
ellipse(width / 2, height / 2 + sin(splashCounter / (PI * 6))*4, height / 3, height / 3);
ellipse(width / 2, height / 2 + sin(splashCounter / (PI * 6))*8, height / 6, height / 6);
ellipse(width / 2+cos(splashCounter / (PI * 12))*2, height / 2 + sin(splashCounter / (PI * 6))*16, height / 24, height / 24);
textAlign(CENTER, CENTER);
translate(width / 2, height / 2 + sin(splashCounter / (PI * 6))*32);
rotate(splashCounter / (PI * 6));
text("flappy brid", 0, 0);
if (pipeImg.width > 0 && bird.width > 0 && birdup.width > 0 && birddown.width > 0)
text("[SPACE] to switch gravity and start!", width / 2, height / 2 + height / 5);
text("Loading...", width / 2, height / 2 + height / 5);
text("please do ignore the big eye", width / 2, height / 2 + height / 4.5);