Skip to content

Commit

Permalink
stop repeated sounds
Browse files Browse the repository at this point in the history
not perfect, ignores if a ball bounces on the same spot multiple times
  • Loading branch information
increpare committed May 8, 2015
1 parent 3d64e04 commit 2928acd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pinball.js
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,8 @@ function ballCollides(){
if(soundpos!==lastsoundpos_bump){
playSound(targetsound,bumperCount===0);
}

lastsoundpos_bump=soundpos;

var direction = (nSpeed[0]*normal[1]-nSpeed[1]*normal[0]);
/* if (direction<0){
console.log("left");
Expand Down
Loading

0 comments on commit 2928acd

Please sign in to comment.