Skip to content

Commit a52c855

Browse files
committed
Revert "Merge branch 'master' of https://github.com/goomazon/FlappyBird-JavaScript"
This reverts commit 810db4b, reversing changes made to cd6dd23.
1 parent 810db4b commit a52c855

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

‎flappyBird.js‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,17 @@ var endcollision = new Audio();
3838
// fly.src = "sounds/fly.mp3";
3939
scor.src = "sounds/score.mp3";
4040
sheesh.src = "sounds/sheesh.mp3";
41-
endcollision.src = "sounds/endcollision.mp3";
41+
endcollision.src = "sounds/endcollision.mp3"
4242

4343
// on key down
4444

4545
document.addEventListener("keydown",moveUp);
46-
endcollision.addEventListener('ended', reloadGame);
4746

4847
function moveUp(){
4948
bY -= 35;
5049
sheesh.play();
5150
}
5251

53-
function reloadGame() {
54-
location.reload();
55-
}
56-
5752
// pipe coordinates
5853

5954
var pipe = [];
@@ -88,8 +83,8 @@ function draw(){
8883
// detect collision
8984

9085
if( bX + bird.width >= pipe[i].x && bX <= pipe[i].x + pipeNorth.width && (bY <= pipe[i].y + pipeNorth.height || bY+bird.height >= pipe[i].y+constant) || bY + bird.height >= cvs.height - fg.height){
91-
// location.reload(); // reload the page
92-
endcollision.play()
86+
endcollision.play();
87+
location.reload(); // reload the page
9388
}
9489

9590
if(pipe[i].x == 5){

0 commit comments

Comments
 (0)