Select Git revision
ChatScreen.java
Forked from
Ho Dac Hai / COMP90015-DSAss2-InfinityMonkeys-remaster
Source project has a limited visibility.
Pipe.java 790 B
import bagel.*;
public class Pipe {
private final double velocity = -5;
private double pos = Window.getWidth(); /* x-coord at spawn */
private final int pixelGap = 168;
/* the higher this value the higher the pipe gap spawns, vice versa */
private final int initialY = 50; /* y-value of pipe at spawn */
private Image pipeImage = new Image("res/pipe.png");
public void Pipe() {
}
public void Render() {
/* upside down pipe */
this.pipeImage.draw(this.pos, -this.initialY);
/* straight up pipe */
DrawOptions options = new DrawOptions();
this.pipeImage.draw(this.pos, Window.getHeight() -this.initialY +this.pixelGap,
options.setRotation(Math.PI));
this.pos += this.velocity;
}
}