var xx,yy,x0,y0,xs,ys; var score=0; var plus=0; var limit=30; var id,id2; var level=1; var s1=s2=-1,inter; function escapeFromMouse(){ s1=s2; ms=new Date(); s2=ms.getTime(); if(s1<0) inter=3000; else inter=s2-s1; with(document){ xs=body.clientWidth-16; ys=body.clientHeight-16; xx=Math.random()*xs; yy=Math.random()*ys; all["ESCAPE"].style.position="absolute"; all["ESCAPE"].style.left=xx; all["ESCAPE"].style.top=yy; score+=plus; if(score<10) all["SCORE"].innerText="0"+score; else all["SCORE"].innerText=score; if(level>1){ plus=Math.floor((xs*ys)/100000); if(id2!="") clearTimeout(id2); id2=setTimeout("changePosition()",inter); all["ESCAPE"].innerText="魔"; } else{ plus=Math.floor((xs*ys)/200000); } all["ADD"].innerText=plus; } if(limit>=30){ limit--; id=setInterval("timeCountDown()",1000); } } function changePosition(){ with(document){ xs=body.clientWidth-16; ys=body.clientHeight-16; xx=Math.random()*xs; yy=Math.random()*ys; plus=Math.floor((xs*ys)/200000); all["ESCAPE"].style.left=xx; all["ESCAPE"].style.top=yy; all["ESCAPE"].innerText="鬼"; all["ADD"].innerText=plus; } } function timeCountDown(){ with(document){ if(limit<10) all["TIME"].innerText="0"+limit; else all["TIME"].innerText=limit; limit--; if(limit<0){ if(id2!="") clearTimeout(id2); clearInterval(id); alert("れべる"+level+"\n"+score+"てん"); all["ESCAPE"].style.position="static"; if(level>1 && score>=100){ all["PRISE"].innerHTML="管理人のプロフィール"; } else if(level<2 && score>=60){ all["PRISE"].innerHTML="魔をマウスで追いかけて"; level=2; } if(level>1) all["ESCAPE"].innerText="魔"; else all["ESCAPE"].innerText="鬼"; score=plus=0; limit=30; id2=""; s2=-1; all["TIME"].innerText=limit; } } }