Game Programming‎ > ‎FlappyBird‎ > ‎

Flappy Bird - Speed Controls

Advanced Enhancements for Flappy Bird

1. Adding a Speed Control for the columns

       1.   Add a “slider” button, add a label field with contents "Speed", 

                 

                2. Set the name to "Speed" and the start/stop values to 1 and 20

                         

                      3. Right-click the slider and add the following script to it:

on scrollbarDrag x

     global colSpeed

     put x into colSpeed   
 scrollbarDrag

                 2. On the card script at the top add a global colSpeed to hold the columns speed

local birdDirection                     // up = -1 down = 1

local gravity

local gameRunning

             global colSpeed


          3. In the preOpenStack handler add the following line:

put 4 into colSpeed

            4.    In the “moveCols” handler:

                        Change the number (4) to the variable (colSpeed)

 


Comments