xxxxxxxxxx
29
let bird;
let pipe;
let pipe2;
function setup() {
createCanvas(400, 400);
bird = new Bird(100, height/2);
pipe = new Pipe(20);
pipe2 = new Pipe(180);
}
function draw() {
background(220);
bird.update();
bird.show();
pipe.update();
pipe.show();
pipe2.update();
pipe2.show();
bird.checkLose(pipe);
bird.checkLose(pipe2);
}
function keyPressed() {
bird.yv = -9;
}