Make the bird jump & add gravity

What should we do with the bird?

Let’s make him jump:

Add below command in the file [File: create-game.js] spaceKey.onDown.add(jump, this);

Working Together

In the repl.it window below, we started the code with the line spaceKey.onDown.add(jump, this);.

alt text

In your console you should see a Jsappy bird jumping after you press run:

alt text

Add gravity

Working Together

In the repl.it 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