Skip to content

Commit

Permalink
added about attributions
Browse files Browse the repository at this point in the history
  • Loading branch information
Zolmeister committed Feb 24, 2014
1 parent b13263c commit b889d8a
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
35 changes: 35 additions & 0 deletions bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function touchDown(e){
initializeOnUp = true
}
}

// audio
if (collideBox(pos, {
x: $canv.width - 25,
y: 10,
Expand All @@ -63,6 +65,39 @@ function touchDown(e){
})){
toggleMute()
}

if(!about) {
// about
if (collideBox(pos, {
x: 10,
y: 10,
width: 40,
height: 20
})){
showAbout()
}
} else {
// zolmeister
if (collideBox(pos, {
x: 32,
y: 10,
width: 80,
height: 12
})){
window.open('http://zolmeister.com')
}

// music attribution
if (collideBox(pos, {
x: 48,
y: 32,
width: 48,
height: 12
})){
window.open('https://soundcloud.com/chrissij')
}
}

}

$canv.addEventListener('mouseup', touchUp)
Expand Down
3 changes: 1 addition & 2 deletions cache.appcache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CACHE MANIFEST
#build 1.2.1
#build 1.2.2

CACHE:
index.html
Expand All @@ -8,7 +8,6 @@ assets/logo.png
assets/drop1.ogg
assets/bg.ogg
assets/enter.png
assets/Leckerli%20One.ttf
assets/logo-small.png
assets/sound-off.png
assets/sound-on.png
Expand Down
28 changes: 26 additions & 2 deletions sound.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
var muted = false
var about = false

popSound = document.createElement('audio')
popSound.src='assets/drop1.ogg'
popSound.volume = 0.4
Expand Down Expand Up @@ -32,10 +34,32 @@ function playPop() {

function drawSoundControl() {
if(typeof ctx === 'undefined') return
//ctx.fillStyle='#111'
//ctx.fillRect($canv.width - 25, 10, 16, 22)
ctx.fillStyle = '#111'
ctx.fillRect($canv.width - 25, 10, 50, 25)
if(muted)
ctx.drawImage(ASSETS.soundOff, $canv.width - 25, 10)
else
ctx.drawImage(ASSETS.soundOn, $canv.width - 25, 10)

if(GAME.state === 'menu' && about) {
ctx.fillStyle = '#111'
ctx.fillRect(10, 10, 50, 20)
ctx.fillStyle = '#333'
ctx.font = 'normal 14px sans'
ctx.fillText('By: Zolmeister', 10, 20)
ctx.font = 'normal 12px sans'
ctx.fillText('Music: Chrissi J', 10, 42)
} else if (GAME.state === 'menu') {
ctx.fillStyle = '#111'
ctx.fillRect(10, 10, 50, 20)
ctx.fillStyle = '#333'
ctx.font = 'normal 12px sans'
ctx.fillText('About', 10, 20)
}

}

function showAbout() {
about = true
drawSoundControl()
}

0 comments on commit b889d8a

Please sign in to comment.