class Bird {
int x;
int y;
color bird_color;
Bird(int x, int y, color bird_color) {
this.x = x;
this.y = y;
this.bird_color = bird_color;
}
void draw() {
fill(this.bird_color);
ellipse(this.x, this.y, 10, 20);
}
void move() {
this.x += 1;
}
void fly() {
this.y -= 1;
}
}
class Banana {
int x;
int y;
Banana(int x, int y) {
this.x = x;
this.y = y;
}
void draw() {
fill(color(255, 255, 0));
ellipse(this.x, this.y, 10, 60);
}
}
Bird bird0;
Bird bird1;
Bird bigbird;
Bird bluejay;
Banana the_banana;
void setup() {
bird0 = new Bird(10, 10, color(255, 0, 0));
bird1 = new Bird(20, 10, color(0, 255, 0));
bigbird = new Bird(40, 50, color(255, 255, 0));
bluejay = new Bird(60, 70, color(0, 0, 255));
the_banana = new Banana(50, 50);
}
void draw() {
background(color(0, 128, 0));
bird0.move();
bird1.move();
bigbird.move();
bluejay.fly();
bird0.draw();
bird1.draw();
bigbird.draw();
bluejay.draw();
the_banana.draw();
}