Select Git revision
Bird.java 792 B
import bagel.Image;
public class Bird {
/* positive means moving up, negative means moving down */
public double velocity;
private static int frameCounterSinceStart = 0;
public Image birdWingUp = new Image("res/birdWingUp.png");
public Image birdWingDown = new Image("res/birdWingDown.png");
public final double acceleration = 0.4;
public final double terminalVelocity = 10;
public final double x = 200;
public double y = 350;
public void Bird() {
}
public void Render() {
if(this.frameCounterSinceStart % 10 == 0) {
this.birdWingUp.draw(this.x, this.y); /* repeat every 10 frames */
}
else {
this.birdWingDown.draw(this.x, this.y);
}
this.frameCounterSinceStart++;
}
}