Skip to content

Commit

Permalink
Merge pull request #45 from buensons/patch-1
Browse files Browse the repository at this point in the history
Gravity update to bird.js
  • Loading branch information
shiffman authored Apr 9, 2018
2 parents e89ca21 + 58d149f commit 8e8a0a3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bird.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Bird {
this.x = 64;

this.gravity = 0.6;
this.lift = -15;
this.lift = -7;
this.velocity = 0;

this.icon = birdSprite;
Expand All @@ -26,12 +26,11 @@ class Bird {
}

up() {
this.velocity += this.lift;
this.velocity = this.lift;
}

update() {
this.velocity += this.gravity;
this.velocity *= 0.9;
this.y += this.velocity;

if (this.y >= height - this.height / 2) {
Expand Down

0 comments on commit 8e8a0a3

Please sign in to comment.