Skip to content
Snippets Groups Projects
Commit 3b6522d9 authored by roguecomp's avatar roguecomp
Browse files

added Bird.class with its own attributes

parent 8d3395e2
Branches
No related tags found
No related merge requests found
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++;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment