rono.ooo 发表于 2018-8-30 10:48:37

鼠标点击速度测试小游戏


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="keywords" content="鼠标点击速度测试小游戏">
<meta name="Description" content="鼠标点击速度测试小游戏">
<title>洛诺-鼠标点击速度测试游戏</title>
</head>
<body>

<SCRIPT LANGUAGE="JavaScript">
gamelength=30;
timerID=null
var playing=false;
var numholes=6*10;
var currentpos=-1;
function clrholes() {
for(var k=0;k<document.dmz.elements.length;k++)
document.dmz.elements.checked=false;
}
function stoptimer() {
if(playing)
clearTimeout(timerID);
}
function showtime(remtime) {
document.cpanel.timeleft.value=remtime;
if(playing) {
if(remtime==0) {
stopgame();
return;
}
else {
temp=remtime-1;
timerID=setTimeout("showtime(temp)",1200);
      }
   }
}
function stopgame() {
        stoptimer();
        playing=false;
        document.cpanel.timeleft.value=0;
        clrholes();
        if (totalhits <0 ) {
                display("靠!你不想玩就别浪费时间了");
                alert('靠!你不想玩就别浪费时间了\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=0 && totalhits <10 ) {
                display("丢人!你是不是高度近视啊?");
                alert('丢人!你是不是高度近视啊?\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=10 && totalhits <20 ) {
                display("不要脸!你到底会不会打CS的啊?");
                alert('不要脸!你到底会不会打CS的啊?\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=20 && totalhits <30 ) {
                display("喂!拜托你认真一点好不好?");
                alert('喂!拜托你认真一点好不好?\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=30 && totalhits <35 ) {
                display("恩!这成绩还不算太丢人!");
                alert('恩!这成绩还不算太丢人!\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=35 && totalhits <40 ) {
                display("不错!但是不要骄傲哦!");
                alert('不错!但是不要骄傲哦!\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=40 && totalhits <45 ) {
                display("挺厉害的嘛!打cs也应该不错!");
                alert('挺厉害的嘛!打cs也应该不错!\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=45 && totalhits <50 ) {
                display("牛人!经常打cs被人当成作弊的吧?");
                alert('牛人!经常打cs被人当成作弊的吧?\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=50 && totalhits <55 ) {
                display("天啊!你该不会真的作弊吧?");
                alert('天啊!你该不会真的作弊吧?\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=55 && totalhits <60 ) {
                display("作弊的!你一定是作弊的!");
                alert('作弊的!你一定是作弊的!\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=60 && totalhits <65 ) {
                display("哇靠!你到底是不是人啊?");
                alert('哇靠!你到底是不是人啊?\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=70 && totalhits <75 ) {
                display("你到底是何方妖孽!报上名来!");
                alert('你到底是何方妖孽!报上名来!\n你一共得了:'+totalhits+'分');
        } else if (totalhits >=75 && totalhits <80 ) {
                display("不可思议!你一定不是人类!");
                alert('不可思议!你一定不是人类!\n你一共得了:'+totalhits+'分');
        } else {
                display("操!你个死外星人给我滚开!这里是人类玩的游戏!");
                alert('操!你个死外星人给我滚开!这里是人类玩的游戏!\n你一共得了:'+totalhits+'分');
        }
}
function play() {
stoptimer();
if(playing) {
stopgame();
return;
}
playing=true;
clrholes();
totalhits=0;
document.cpanel.score.value=totalhits;
display("请点击下面随机选择的圈圈!");
launch();
showtime(gamelength);
}
function display(msg) {
document.cpanel.state.value=msg;
}
function launch() {
var launched=false;
while(!launched) {
mynum=random();
if(mynum!=currentpos) {
document.dmz.elements.checked=true;
currentpos=mynum;
launched=true;
      }
   }
}

function hithead(id) {
if(playing==false) {
clrholes();
display("请点击上面的按钮开始游戏");
return;
}
if(currentpos!=id) {
totalhits+=-1;
document.cpanel.score.value=totalhits;
document.dmz.elements.checked=false;
}
else {
totalhits+=1;
document.cpanel.score.value=totalhits;
launch();
document.dmz.elements.checked=false;
   }
}

function random() {
return(Math.floor(Math.random()*100%numholes));
}
// End -->
</script>
<center><h2>测试你鼠标点击控制能力</h2></center>
<p align="center">
30秒内击中下面电脑随机选择的圈圈<br>
每点中一个加一分,点错一个扣一分<br>
(据说有位CS高手30秒内点中95下,你能吗?)
<form name="cpanel">
<center>
<table cellspacing=3>
<tr>
<td><input type="button" name="startstop" value="开始游戏/结束游戏" onClick="play()"></td>
<td><pre>    </pre></td>
<td align=right>时间:</td>
<td><input type="text" name="timeleft" size="4" onFocus="this.blur()"></td>
</tr>
<tr>
<td>
<input type="text" name="state" value="请单击上面按钮开始游戏!" onFocus="this.blur()" size="23"></td>
<td><pre>    </pre></td>
<td align=right>分数:</td>
<td><input type="text" name="score" size="4" onFocus="this.blur()"></td>
</tr>
</table>
</center>
</form>
<form name="dmz">
<center>
<table cellpadding="2" cellspacing=2>
<tr>
<td colspan=10><hr size=1></td>
</tr>
<tr>
<td><input type="radio" onClick="hithead(0)"></td>
<td><input type="radio" onClick="hithead(1)"></td>
<td><input type="radio" onClick="hithead(2)"></td>
<td><input type="radio" onClick="hithead(3)"></td>
<td><input type="radio" onClick="hithead(4)"></td>
<td><input type="radio" onClick="hithead(5)"></td>
<td><input type="radio" onClick="hithead(6)"></td>
<td><input type="radio" onClick="hithead(7)"></td>
<td><input type="radio" onClick="hithead(8)"></td>
<td><input type="radio" onClick="hithead(9)"></td>
</tr>
<tr>
<td><input type="radio" onClick="hithead(10)"></td>
<td><input type="radio" onClick="hithead(11)"></td>
<td><input type="radio" onClick="hithead(12)"></td>
<td><input type="radio" onClick="hithead(13)"></td>
<td><input type="radio" onClick="hithead(14)"></td>
<td><input type="radio" onClick="hithead(15)"></td>
<td><input type="radio" onClick="hithead(16)"></td>
<td><input type="radio" onClick="hithead(17)"></td>
<td><input type="radio" onClick="hithead(18)"></td>
<td><input type="radio" onClick="hithead(19)"></td>
</tr>
<tr>
<td><input type="radio" onClick="hithead(20)"></td>
<td><input type="radio" onClick="hithead(21)"></td>
<td><input type="radio" onClick="hithead(22)"></td>
<td><input type="radio" onClick="hithead(23)"></td>
<td><input type="radio" onClick="hithead(24)"></td>
<td><input type="radio" onClick="hithead(25)"></td>
<td><input type="radio" onClick="hithead(26)"></td>
<td><input type="radio" onClick="hithead(27)"></td>
<td><input type="radio" onClick="hithead(28)"></td>
<td><input type="radio" onClick="hithead(29)"></td>
</tr>
<tr>
<td><input type="radio" onClick="hithead(30)"></td>
<td><input type="radio" onClick="hithead(31)"></td>
<td><input type="radio" onClick="hithead(32)"></td>
<td><input type="radio" onClick="hithead(33)"></td>
<td><input type="radio" onClick="hithead(34)"></td>
<td><input type="radio" onClick="hithead(35)"></td>
<td><input type="radio" onClick="hithead(36)"></td>
<td><input type="radio" onClick="hithead(37)"></td>
<td><input type="radio" onClick="hithead(38)"></td>
<td><input type="radio" onClick="hithead(39)"></td>
</tr>
<tr>
<td><input type="radio" onClick="hithead(40)"></td>
<td><input type="radio" onClick="hithead(41)"></td>
<td><input type="radio" onClick="hithead(42)"></td>
<td><input type="radio" onClick="hithead(43)"></td>
<td><input type="radio" onClick="hithead(44)"></td>
<td><input type="radio" onClick="hithead(45)"></td>
<td><input type="radio" onClick="hithead(46)"></td>
<td><input type="radio" onClick="hithead(47)"></td>
<td><input type="radio" onClick="hithead(48)"></td>
<td><input type="radio" onClick="hithead(49)"></td>
</tr>
<tr>
<td><input type="radio" onClick="hithead(50)"></td>
<td><input type="radio" onClick="hithead(51)"></td>
<td><input type="radio" onClick="hithead(52)"></td>
<td><input type="radio" onClick="hithead(53)"></td>
<td><input type="radio" onClick="hithead(54)"></td>
<td><input type="radio" onClick="hithead(55)"></td>
<td><input type="radio" onClick="hithead(56)"></td>
<td><input type="radio" onClick="hithead(57)"></td>
<td><input type="radio" onClick="hithead(58)"></td>
<td><input type="radio" onClick="hithead(59)"></td>
</tr>
<tr><td colspan=10 align="center"></td>
</tr></table></center></form>

</body>
</html>小游戏演示网站   可以做一个小游戏放到自己网站上面哦~
本人最高记录48个   平均44个

rono.ooo 发表于 2018-8-30 10:50:02

记得选中UTF-8编码哦#pao40#

dahuhu 发表于 2018-8-30 10:54:31

小白路过

dsdt 发表于 2018-8-30 11:12:33

有键盘测试得吗

wrrsxz 发表于 2018-8-30 12:44:43

#pao36#累断手

Src 发表于 2018-8-30 15:35:20


有键盘测试得吗

小苍dy 发表于 2018-8-30 16:23:49



有键盘测试得吗

wmt 发表于 2018-8-30 19:59:12

#pao27#看来有自学js的必要了

小鱼和喵喵 发表于 2018-8-31 04:29:05

#pao22#有点意思

xm123456 发表于 2018-8-31 14:00:53

谢谢楼主分享#pao48#

albertmingliang 发表于 2018-8-31 22:48:29

支持一下

Yume 发表于 2018-8-31 23:30:41

感谢分享~

242310096 发表于 2018-9-1 09:06:52

感谢分享

Hidarihitomi 发表于 2018-9-11 17:16:27

#pao34##pao34##pao34#

1757472335 发表于 2018-9-13 13:14:12

我30多是不是废了
页: [1] 2
查看完整版本: 鼠标点击速度测试小游戏