How to Make Pipes Move in Your Flappy Bat Game - dummies

How to Make Pipes Move in Your Flappy Bat Game

By Derek Breen

In the original Flappy Bird game, pipes keep moving from right to left, while the player moves up and down. To further distinguish your Flappy Bat game from that other Flappy, you will add code that moves the pipe from left to right.

  1. On the Stage, click and drag the pipe all the way to the left edge.

    image0.jpg

  2. Click the Scripts tab.

  3. Drag the following blocks into the Scripts Area to make the pipes move left to right:

    image1.jpg

  4. Click the Green Flag to test your code.

The pipe should zoom right past the bat. The blocks should look familiar. Can you figure out how to slow down the pipe? Click the Player sprite icon if you need to refresh your Scratch-block memory.

You could add a WAIT block to slow down the Pipe sprite movement. The more elegant solution would be to try a lower X value in CHANGE X BY. Click the default value of 10, change it to 4, and click the Green Flag button. If the pipe is still too slow, reduce X value a bit. If it’s too fast, increase it a bit.

image2.jpg

This should give you an idea about how to change the difficulty of your game, right? The game won’t be very difficult if the pipe passes right over the player as if the bat were not even there.