Skip to content

Commit

Permalink
Pause/Play music
Browse files Browse the repository at this point in the history
  • Loading branch information
Croquetx committed May 9, 2024
1 parent 6afbf3e commit d3c06ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Pawns-Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class AvatarPawn extends mix(Pawn).with(PM_Smoothed, PM_ThreeVisible, PM_
this.turn = 1; break;
case "ArrowRight": case "D": case "d":
this.turn = -1; break;
case "M": case "m":
case "O": case "o":
if (this.developerMode === 5) this.auto = !this.auto; break;
case "H": case "h":
if (this.developerMode === 5) this.goHome(); break;
Expand Down Expand Up @@ -304,6 +304,10 @@ export class AvatarPawn extends mix(Pawn).with(PM_Smoothed, PM_ThreeVisible, PM_
soundLoops.forEach( sound => {if (soundSwitch) sound.play(); else sound.pause();} );
console.log( "sound is " + soundSwitch);
break;
case 'm': case 'M':
console.log("pause/play music");
soundLoops.forEach( sound => {if (sound.isPlaying) sound.pause(); else sound.play();} );
break;
default:
}
}
Expand Down

0 comments on commit d3c06ca

Please sign in to comment.