Functions are cool

I was working on a game that was inspired by flappy bird.
I made a function to create new pipes for the player to dodge.
How do I make it so that the pipes move towards the player.
How do I let the pipes generate?

My code URL is: