summaryrefslogtreecommitdiffstats
path: root/js/mapspecs.js
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2012-11-01 01:16:42 -0700
committerPatrick Davison <snapwilliam@gmail.com>2012-11-01 01:16:42 -0700
commit4158e556d247830832b631fd4ef869e7c8e541e5 (patch)
treefacc402062b4b71913185d0dda68be4dbd69e95f /js/mapspecs.js
parentc4058d01960509846b12621c0a0ed5547d1b0a0f (diff)
downloadpathery-4158e556d247830832b631fd4ef869e7c8e541e5.tar.xz
Sounds, soundManager2
Created and added "blingb" sound. Added a couple images to the cache Started adding soundManager2 - needs work. More testing on the multi-path animation code. General cleanup on the sounds. Changed the "Improved score 0 to X" to "You scored X"
Diffstat (limited to 'js/mapspecs.js')
-rw-r--r--js/mapspecs.js31
1 files changed, 24 insertions, 7 deletions
diff --git a/js/mapspecs.js b/js/mapspecs.js
index 3ad1a80..e983d63 100644
--- a/js/mapspecs.js
+++ b/js/mapspecs.js
@@ -442,6 +442,8 @@ function doanimate(x, y, p, c, mapid, pathNumber) {
case 100:
case 50:
if (checkSound(mapid)) {
+ soundManager.setVolume('charm', 40);
+ soundManager.setPan('charm', 75)
soundManager.play('charm');
}
//Flash
@@ -450,7 +452,7 @@ function doanimate(x, y, p, c, mapid, pathNumber) {
}
childdiv = document.getElementById('child_'+handle.id);
- if (childdiv.className != 'grid_td_walls') {
+ if (childdiv.className.indexOf('grid_td_walls') < 0) {
childdiv.setAttribute('class', 'grid_td_path'+pathNumber+'-'+c);
var origColor = rgbStringToHex(handle.style.backgroundColor);
@@ -458,7 +460,6 @@ function doanimate(x, y, p, c, mapid, pathNumber) {
handle.style.backgroundColor = mapdata[mapid].pathColor[pathNumber];
-
string = "if (document.getElementById('"+'child_'+eid+"').className == 'grid_td_path"+pathNumber+'-'+c+"')";
string += "document.getElementById('"+'child_'+eid+"').removeAttribute('class');";
setTimeout(string, 855);
@@ -517,10 +518,16 @@ function doanimate(x, y, p, c, mapid, pathNumber) {
}
//Sound effects
- if (c == 'r') {
+ if (t == 'r') {
if (checkSound(mapid)) {
- soundManager.setVolume('bling', 50);
- soundManager.play('bling');
+ soundManager.setVolume('bling', 40);
+ soundManager.setPan('bling', -75)
+ soundManager.setVolume('blingb', 40);
+ soundManager.setPan('blingb', 75)
+ if (pathNumber == 0)
+ soundManager.play('bling');
+ if (pathNumber == 1)
+ soundManager.play('blingb');
}
}
@@ -542,7 +549,8 @@ function doanimate(x, y, p, c, mapid, pathNumber) {
//Saw someone do this, thought it was clever.
//Switch for range result.
var disptext = ""
- var improvedScore = (count[mapid] > mapjson[mapid].mybest);
+ var improvedScore = (count[mapid] > mapjson[mapid].mybest && mapjson[mapid].mybest != "0");
+ console.log(mapjson[mapid].mybest,mapjson[mapid].mybest == 0 )
switch (true) {
case (count[mapid] > mapjson[mapid].best):
disptext = "Beat "+mapjson[mapid].bestby+"'s record of "+mapjson[mapid].best+" with "+count[mapid]+"!";
@@ -552,6 +560,10 @@ function doanimate(x, y, p, c, mapid, pathNumber) {
disptext = "Tied "+mapjson[mapid].bestby+"'s record of "+mapjson[mapid].best;
break;
+ case (mapjson[mapid].mybest == "0"):
+ disptext = "You scored "+count[mapid]+"!";
+ break;
+
case (count[mapid] > mapjson[mapid].mybest):
disptext = "Improved score "+mapjson[mapid].mybest+ " to "+count[mapid];
break;
@@ -670,9 +682,14 @@ function doanimate(x, y, p, c, mapid, pathNumber) {
//Teleport Element ID
tpEid = mapid+','+x+','+y;
if (checkSound(mapid)) {
- soundManager.setVolume('ufoblip', 50);
+ soundManager.setVolume('ufoblip', 30);
+ if (pathNumber == 0)
+ soundManager.setPan('ufoblip', 70);
+ else
+ soundManager.setPan('ufoblip', -70);
soundManager.play('ufoblip');
}
+
document.getElementById(eid).style.backgroundColor='#CCCCCC';
document.getElementById(tpEid).style.backgroundColor='#CCCCCC';