Skip to content

Commit 7da292f

Browse files
committed
endcollide
1 parent 8340b93 commit 7da292f

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎flappyBird.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ var score = 0;
3030

3131
// audio files
3232

33-
var fly = new Audio();
33+
// var fly = new Audio();
3434
var scor = new Audio();
35-
var sheesh = new Audio()
35+
var sheesh = new Audio();
36+
var endcollision = new Audio();
3637

37-
fly.src = "sounds/fly.mp3";
38+
// fly.src = "sounds/fly.mp3";
3839
scor.src = "sounds/score.mp3";
3940
sheesh.src = "sounds/sheesh.mp3";
41+
endcollision.src = "sounds/endcollision.mp3"
4042

4143
// on key down
4244

@@ -81,6 +83,7 @@ function draw(){
8183
// detect collision
8284

8385
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){
86+
endcollision.play();
8487
location.reload(); // reload the page
8588
}
8689

‎sounds/endcollision.mp3‎

88.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)