logo

Crowdly

Browser

Add to Chrome

In a Flappy Bird game, the bird’s vertical position is tracked by birdY, and isF...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

In a Flappy Bird game, the bird’s vertical position is tracked by birdY, and isFlapping is a variable that prevents the bird from flapping again while it is still rising. Given the following code snippet, what happens when the spacebar is pressed while the bird is falling?

if (birdY > 300) {

  isFlapping = false;

}

if (keyIsPressed && key == " " && !isFlapping) {

  velocityY = -12;

  isFlapping = true;

  flap.play();

}

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on elearning.aua.am?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome