Code làm chuột có mấy cái vòng tròn

3 200 0
Code làm chuột có mấy cái vòng tròn

Đang tải... (xem toàn văn)

Thông tin tài liệu

CODE Làm Con Chuột Có Mấy Cái Vòng Chạy Chạy Xung Quanh MAy = e.pageY-window.pageYOffset; MAx = e.pageX; } if (n4) window.onMouseMove=mouse1; else document.onmousemove=mouse1; } if (ie||o6){ function mouse2(){ if (put) return false; MAy = (ie)?event.clientY:event.clientY-window.pageYOffset; MAx = event.clientX; } document.onmousemove=mouse2; } if (n4){ for (inc=0; inc < num; inc++) document.write(’’); } else{ if (ie&&!o6){ document.write(””); document.write(””); } for (inc=0; inc < num; inc++) document.write(’.’); if (ie&&!o6) document.write(””); } function pos(){ h=(ie)?document.body.clientHeight:window.innerHeig ht-20; w=(ie)?document.body.clientWidth:window.innerWidth-20; ry=Math.round(Math.random()*h); rx=Math.round(Math.random()*w); rep=Math.round(Math.random()*3); if (rep == 3)ry=0; if (rep == 2)ry=h; if (rep == 1)rx=0; if (rep == 0)rx=w; py=ry; px=rx; } pos(); function followleader(){ sy=(!ie)?window.pageYOffset:0; sx=(!ie)?window.pageXOffset:0; if (ie) outer.style.top=document.body.scrollTop; for (inc=0; inc < num; inc++){ randomcol=col[Math.floor(Math.random()*col.length)]; temp1=eval(_d+_a+”dots”+inc+_r+_s); temp1.visibility=v; if (inc < num-1){ temp2=eval(_d+_a+”dots”+(inc+1)+_r+_s); temp1.top=temp2.top; temp1.left=temp2.left } else{ temp1.top=py+sy; temp1.left=px; } if (n4)temp1.bgColor=randomcol; else temp1.background=randomcol; } } function bomb(){ ay=MAy-py; ax=MAx-px; angle=Math.round(Math.atan2(ay,ax)*180/Math.PI); if (angle < 0) angle += 360; MAdy=py-MAy; MAdx=px-MAx; distance=Math.floor(Math.sqrt(MAdx*MAdx+MAdy*MAdy) ); go_y = Math.round(vel*Math.sin(angle*Math.PI/180)); go_x = Math.round(vel*Math.cos(angle*Math.PI/180)); py+=go_y; px+=go_x; if (distance < vel) pos(); followleader(); tmr=setTimeout(”bomb()”,20); } bomb(); function dsbl(){ v=(n4)?”hide”:”hidden”; put=true; MAx=0; MAy=0; setTimeout(’clearTimeout(tmr)’,stopafter+100); } setTimeout(’dsbl()’,stopafter); //–>

Ngày đăng: 05/11/2015, 11:40

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan