Adding a Turbo mode - Two Ways 1. With a keyboard key 1. Add a label field with the contents: Press the "T" key for Turbo Mode 2. On the card script, ,at the top add the new global variable - colSpeed where the other variables are local birdDirectionlocal gravitylocal gameRunningglobal colSpeed 3. On the card script, in the "startGame" handler add the following: put 4 into colSpeed 4. On the card script, in the "moveCols" handler change the number 4 to colSpeed 5. On the card script, in the "keyDown" handler add the following code:
or if you want it to speed up more than once, (add 5 every time they press the spacebar)
2. With a button We can add a button to the screen to put the columns into a "Turbo" mode where they go twice as fast 1. Add a button called "Turbo" and put the following script on it
2. On the card script, ,at the top add the new global variable - colSpeed where the other variables are
3. On the card script, in the "startGame" handler add the following: put 4 into colSpeed 4. On the card script, in the "moveCols" handler change the number 4 to colSpeed
|
Game Programming > FlappyBird >

