@Override
	public void paintComponent(Graphics g) {
		Graphics2D g2 = (Graphics2D) g;
		if (!this.dead) {
			// Updates the x value of the pipe
			if (this.x1 < -151) {
				this.x1 = 930;
				this.score++;
				this.pipeA = new Pipes(this.x1,this.PIPEPATH);
			}
			if (this.x1 < -151) {
				this.score++;
				this.x1 = 930;
				this.pipeA = new Pipes(this.x1,this.PIPEPATH);
			}
			this.x1 -= 4;
			this.x2 -= 4;
			// draws the pipe
			this.pipeA.draw(g2, this.x1);
			this.pipeB.draw(g2, this.x2);
			// bird
			this.bird.draw(g2);
			// Checks if dead
			if(Math.abs(Main.FRAMEWIDTH/2-(this.x1-50))<50){
				this.checkDead(this.pipeA);
			}
			if(Math.abs(Main.FRAMEWIDTH/2-(this.x2-50))<50){
				this.checkDead(this.pipeB);
			}
			
			
		} else {
			//death Screen
			ImageRendering.drawImage(g2, "Graphics/gameOver.png", 400, 450, 0);
		}
	}