Skip to content

Commit

Permalink
added background music
Browse files Browse the repository at this point in the history
  • Loading branch information
Zolmeister committed Feb 24, 2014
1 parent 4c4e17e commit b13263c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Binary file added assets/bg.ogg
Binary file not shown.
4 changes: 2 additions & 2 deletions cache.appcache
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
CACHE MANIFEST
#build 1.1.3
#build 1.2.1

CACHE:
#NETWORK:
index.html
libs/stats.js
assets/logo.png
assets/drop1.ogg
assets/bg.ogg
assets/enter.png
assets/Leckerli%20One.ttf
assets/logo-small.png
Expand Down
9 changes: 8 additions & 1 deletion sound.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@ popSound = document.createElement('audio')
popSound.src='assets/drop1.ogg'
popSound.volume = 0.4

bgSound = document.createElement('audio')
bgSound.src='assets/bg.ogg'
bgSound.volume = 0.6
bgSound.play()

if(localStorage.muted === 'true') toggleMute()

function toggleMute(){
if(!muted) {
popSound.volume = 0
bgSound.volume = 0
muted = true
localStorage.muted = 'true'
drawSoundControl()
} else {
popSound.volume = 0.6
popSound.volume = 0.4
bgSound.volume = 0.6
muted = false
localStorage.muted = 'false'
drawSoundControl()
Expand Down

0 comments on commit b13263c

Please sign in to comment.