Game play is pretty limited in this game, isn’t it? The user can only press the spacebar to move the sprite up. In this add-on, create a button that allows the sprite to dive, or move down faster than it falls. First, you need to program a key that will tell the bird to dive - this example will use the down arrow - and some way to check if the user is pressing that button. If the user is not hitting the spacebar, he or she might be clicking the down arrow. If the user isn’t clicking either, the bird should still move down, just more slowly. This example will remove the “switch costume to parrot b” and “change y by -5” blocks from the else section of this if-else statement, keeping them to the side to use later.
Then, you will add an "if-else" into the "else"where you just removed the code.
Then, add the "key down arrow pressed" block to the inner if-else statement.
If neither the down arrow nor the space bar are pressed, the bird should still move down, so add the “switch costume” and “change y by blocks that you previously removed to the else.
If the down arrow is pressed, however, the bird should move down faster. Tinker with the values to change the speed the sprite falls. This example uses “change y by -10."
This now reads: “If the spacebar key was pressed, change to parrot-b costume and move up 5. Otherwise, if the spacebar key hasn’t been pressed, then check If the down arrow was pressed.
If it was, then switch to costume parrot-a and change y by minus ten. If the down arrow wasn’t pressed, go down more slowly.” Ok. That seems right.
Test the code to see if it works.