Add sound while the bird is jumping & bonus

Let’s add sounds to the bird while it is jumping

Add the below command in the file [File: create-game.js];

Working Together

In the Replit window below, we started the code with the line;.

alt text

In your console you should see a Jsappy bird jumping with sound after you press run.

Bonus activities

  • What happens if we make gravity stronger?
  • What happens if we make gravity have a negative value?
  • What other wacky ways can the bird jump?
  • How can we make him rotate quicker?
  • What happens if we remove the ‘if’ around the rotation?

You did it!
Workshop completed!