Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class Pipe {

hits(bird) {
let halfBirdHeight = bird.height / 2;
let halfBirdwidth = bird.width / 2;
let halfBirdWidth = bird.width / 2;
if (bird.y - halfBirdHeight < this.top || bird.y + halfBirdHeight > this.bottom) {
//if this.w is huge, then we need different collision model
if (bird.x + halfBirdwidth > this.x && bird.x - halfBirdwidth < this.x + this.w) {
if (bird.x + halfBirdWidth > this.x && bird.x - halfBirdWidth < this.x + this.w) {
this.highlight = true;
this.passed = true;
return true;
Expand Down