function Run(){
var temp = Info.value;
if(temp == '')return;
ReadMap(useLevel);
BackRecord=temp.split("")
Timer = setInterval(ReDo,RePlayTime);
}
function iSelects(x){
var iRange = Info.createTextRange();
iRange.collapse(true);
iRange.moveStart("character",x);
iRange.moveEnd("character",1);
iRange.select();
BoxMoveInfo.value = BoxMoves;
ManMoveInfo.value = x+1;
}
function GetCookie(sName){
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++){
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return unescape(aCrumb[1]);
}
return 0;
}
function SetCookie(sName, sValue){
dt = new Date();
dt.setTime(dt.getTime()+(365*24*3600*1000));
document.cookie = sName + "=" + escape(sValue) + "; expires=" + dt.toGMTString();
}
function SaveLevel(){
SetCookie("Level",useLevel);
SetCookie("Move",Info.value);
tmp = useLevel+1;
alert("保存第 "+ tmp +" 关数据成功!");
}
function LoadLevel(){
useLevel = GetCookie("Level");
ReadMap(parseInt(useLevel));
window.focus();
Base.focus();
Info.value = GetCookie("Move");
Run();
tmp = parseInt(useLevel)+1;
alert("成功载入第 "+ tmp +" 关数据!");
}
function CustomLevel(){
totallevel = Map.length;
tmp = useLevel+1;
var level = window.prompt("总共有 "+ totallevel +" 关,请选择:",tmp);
if(level==null) return;
if(parseInt(level) != "NaN" && level<=totallevel){
useLevel = level - 1;
ReadMap(useLevel);
window.focus();
Base.focus();
}
else{
alert("选择关数出错!!!");
}
}
level_dat.js:
var Map = [];
文章来源于领测软件测试网 https://www.ltesting.net/