diff --git a/src/Pipe.java b/src/Pipe.java new file mode 100644 index 0000000000000000000000000000000000000000..3ebc9f053475ea9e161f76cae929103a24fed314 --- /dev/null +++ b/src/Pipe.java @@ -0,0 +1,28 @@ +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; + } +} \ No newline at end of file