diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2011-09-10 01:44:35 -0700 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2011-09-10 01:44:35 -0700 |
commit | f5fae4bbf7d84419cf4ecb38238bfb9bb2f911e5 (patch) | |
tree | 5d6a70ddea2a88268372ee63bcff99f13b5c05ec /js | |
parent | 33dfdb5654c3ba8fe43203e3212cefd8495cf2ea (diff) | |
download | pathery-f5fae4bbf7d84419cf4ecb38238bfb9bb2f911e5.tar.xz |
Tutorial started
Diffstat (limited to 'js')
-rw-r--r-- | js/mapspecs.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/js/mapspecs.js b/js/mapspecs.js index fe58658..17e4a74 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -8,6 +8,9 @@ window.onload = function(){ //document.getElementById('blocksdisplay').innerHTML = "<b>"+blocks+"</b>";
//doSend();
loadSol();
+ if (ischallenge == true) {
+ challengehint();
+ }
}
var solution = new Array();
@@ -274,6 +277,9 @@ function animatePathDone(mapid) { updateDsp(mapid, 'dspScore', htmlscores);
htmlscores = '';
}
+ if (ischallenge == true) {
+ challengecomplete(mapid);
+ }
}
function request_scores_done() {
@@ -624,12 +630,16 @@ function doanimate(x, y, p, c, mapid) { setTimeout("doanimate("+x+","+y+",'"+p+"','"+t+"','"+mapid+"')",rs);
}
-function flashelement(eid, times, color) {
+function flashelement(eid, times, color, speed) {
//alert("exe"+eid);
if (document.getElementById(eid) == undefined) return;
if (!color) {
color = "#FFFF44";
}
+ if (!speed) {
+ speed = 220;
+ }
+ speedon = speed * .5;
//document.getElementById(eid).setAttribute('class', 'no_transition');
var currentclass = document.getElementById(eid).className;
if (document.getElementById(eid).classOrigName != undefined)
@@ -639,17 +649,17 @@ function flashelement(eid, times, color) { document.getElementById(eid).style.backgroundColor = '#000000';
for (var i=0; i<times; i++) {
//Flash bright
- setTimeout("document.getElementById('"+eid+"').style.color = '#000000'", i*220);
- setTimeout("document.getElementById('"+eid+"').style.backgroundColor = '"+color+"'", i*220);
+ setTimeout("document.getElementById('"+eid+"').style.color = '#000000'", i*speed);
+ setTimeout("document.getElementById('"+eid+"').style.backgroundColor = '"+color+"'", i*speed);
// setTimeout("document.getElementById('"+mapid+",dspCount').style.fontWeight = 'bold'", i*200);
//Flash out
- setTimeout("document.getElementById('"+eid+"').style.color = ''", (i*220) + 100);
- setTimeout("document.getElementById('"+eid+"').style.backgroundColor = ''", (i*220) + 100);
+ setTimeout("document.getElementById('"+eid+"').style.color = ''", (i*speed) + speedon);
+ setTimeout("document.getElementById('"+eid+"').style.backgroundColor = ''", (i*speed) + speedon);
// setTimeout("document.getElementById('"+mapid+",dspCount').style.fontWeight = ''", i*200);
}
//setTimeout("document.getElementById('"+eid+"').className = '"+currentclass+"'", (i*220) + 200);
- setTimeout("document.getElementById('"+eid+"').style.backgroundColor = '"+currentColor+"'", (i*220) + 200);
+ setTimeout("document.getElementById('"+eid+"').style.backgroundColor = '"+currentColor+"'", (i*speed) + 200);
//document.getElementById(eid).className=currentclass;
//document.getElementById(eid).style.backgroundColor=currentColor;
}
|