Add gravity

Let’s add gravity to the bird:

Add below command in the file [File: create-game.js] bird.body.gravity.y = 900;

Working Together

In the window below, we started the code with the line bird.body.gravity.y = 900;.

alt text

In your console you should see a JSappy bird jumping with gravity after you press run:

alt text