Skip to content

Commit

Permalink
Merge pull request xviniette#18 from sunrei/fix_bird_position
Browse files Browse the repository at this point in the history
Fix bird position, minor optimization
  • Loading branch information
xviniette authored Nov 15, 2016
2 parents 5ed50c2 + 56f133f commit d6a163f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions game.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,9 @@ Game.prototype.display = function(){
for(var i in this.birds){
if(this.birds[i].alive){
this.ctx.save();
this.ctx.translate(this.birds[i].x, this.birds[i].y);
this.ctx.translate(this.birds[i].width/2, this.birds[i].height/2);
this.ctx.translate(this.birds[i].x + this.birds[i].width/2, this.birds[i].y + this.birds[i].height/2);
this.ctx.rotate(Math.PI/2 * this.birds[i].gravity/20);
this.ctx.drawImage(images.bird, -this.birds[i].width, -this.birds[i].height/2, this.birds[i].width, this.birds[i].height);
this.ctx.drawImage(images.bird, -this.birds[i].width/2, -this.birds[i].height/2, this.birds[i].width, this.birds[i].height);
this.ctx.restore();
}
}
Expand Down

0 comments on commit d6a163f

Please sign in to comment.