找回密码
 创建账号

QQ登录

只需一步,快速开始

查看: 4655|回复: 16

[原创软件] 鼠标点击速度测试小游戏

[复制链接]
  • TA的每日心情
    擦汗
    2018-10-2 10:48
  • 签到天数: 3 天

    连续签到: 2 天

    [LV.2]天邪鬼

    发表于 2018-8-30 10:48:37 | 显示全部楼层 |阅读模式
    1. <html>
    2. <head>
    3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    4. <meta http-equiv="Content-Language" content="zh-CN" />
    5. <meta name="keywords" content="鼠标点击速度测试小游戏">
    6. <meta name="Description" content="鼠标点击速度测试小游戏">
    7. <title>洛诺-鼠标点击速度测试游戏</title>
    8. </head>
    9. <body>

    10. <SCRIPT LANGUAGE="JavaScript">
    11. gamelength=30;
    12. timerID=null
    13. var playing=false;
    14. var numholes=6*10;
    15. var currentpos=-1;
    16. function clrholes() {
    17. for(var k=0;k<document.dmz.elements.length;k++)
    18. document.dmz.elements[k].checked=false;
    19. }
    20. function stoptimer() {
    21. if(playing)
    22. clearTimeout(timerID);
    23. }
    24. function showtime(remtime) {
    25. document.cpanel.timeleft.value=remtime;
    26. if(playing) {
    27. if(remtime==0) {
    28. stopgame();
    29. return;
    30. }
    31. else {
    32. temp=remtime-1;
    33. timerID=setTimeout("showtime(temp)",1200);
    34.       }
    35.    }
    36. }
    37. function stopgame() {
    38.         stoptimer();
    39.         playing=false;
    40.         document.cpanel.timeleft.value=0;
    41.         clrholes();
    42.         if (totalhits <0 ) {
    43.                 display("靠!你不想玩就别浪费时间了");
    44.                 alert('靠!你不想玩就别浪费时间了\n你一共得了:  '+totalhits+'分');
    45.         } else if (totalhits >=0 && totalhits <10 ) {
    46.                 display("丢人!你是不是高度近视啊?");
    47.                 alert('丢人!你是不是高度近视啊?\n你一共得了:  '+totalhits+'分');
    48.         } else if (totalhits >=10 && totalhits <20 ) {
    49.                 display("不要脸!你到底会不会打CS的啊?");
    50.                 alert('不要脸!你到底会不会打CS的啊?\n你一共得了:  '+totalhits+'分');
    51.         } else if (totalhits >=20 && totalhits <30 ) {
    52.                 display("喂!拜托你认真一点好不好?");
    53.                 alert('喂!拜托你认真一点好不好?\n你一共得了:  '+totalhits+'分');
    54.         } else if (totalhits >=30 && totalhits <35 ) {
    55.                 display("恩!这成绩还不算太丢人!");
    56.                 alert('恩!这成绩还不算太丢人!\n你一共得了:  '+totalhits+'分');
    57.         } else if (totalhits >=35 && totalhits <40 ) {
    58.                 display("不错!但是不要骄傲哦!");
    59.                 alert('不错!但是不要骄傲哦!\n你一共得了:  '+totalhits+'分');
    60.         } else if (totalhits >=40 && totalhits <45 ) {
    61.                 display("挺厉害的嘛!打cs也应该不错!");
    62.                 alert('挺厉害的嘛!打cs也应该不错!\n你一共得了:  '+totalhits+'分');
    63.         } else if (totalhits >=45 && totalhits <50 ) {
    64.                 display("牛人!经常打cs被人当成作弊的吧?");
    65.                 alert('牛人!经常打cs被人当成作弊的吧?\n你一共得了:  '+totalhits+'分');
    66.         } else if (totalhits >=50 && totalhits <55 ) {
    67.                 display("天啊!你该不会真的作弊吧?");
    68.                 alert('天啊!你该不会真的作弊吧?\n你一共得了:  '+totalhits+'分');
    69.         } else if (totalhits >=55 && totalhits <60 ) {
    70.                 display("作弊的!你一定是作弊的!");
    71.                 alert('作弊的!你一定是作弊的!\n你一共得了:  '+totalhits+'分');
    72.         } else if (totalhits >=60 && totalhits <65 ) {
    73.                 display("哇靠!你到底是不是人啊?");
    74.                 alert('哇靠!你到底是不是人啊?\n你一共得了:  '+totalhits+'分');
    75.         } else if (totalhits >=70 && totalhits <75 ) {
    76.                 display("你到底是何方妖孽!报上名来!");
    77.                 alert('你到底是何方妖孽!报上名来!\n你一共得了:  '+totalhits+'分');
    78.         } else if (totalhits >=75 && totalhits <80 ) {
    79.                 display("不可思议!你一定不是人类!");
    80.                 alert('不可思议!你一定不是人类!\n你一共得了:  '+totalhits+'分');
    81.         } else {
    82.                 display("操!你个死外星人给我滚开!这里是人类玩的游戏!");
    83.                 alert('操!你个死外星人给我滚开!这里是人类玩的游戏!\n你一共得了:  '+totalhits+'分');
    84.         }
    85. }
    86. function play() {
    87. stoptimer();
    88. if(playing) {
    89. stopgame();
    90. return;
    91. }
    92. playing=true;
    93. clrholes();
    94. totalhits=0;
    95. document.cpanel.score.value=totalhits;
    96. display("请点击下面随机选择的圈圈!");
    97. launch();
    98. showtime(gamelength);
    99. }
    100. function display(msg) {
    101. document.cpanel.state.value=msg;
    102. }
    103. function launch() {
    104. var launched=false;
    105. while(!launched) {
    106. mynum=random();
    107. if(mynum!=currentpos) {
    108. document.dmz.elements[mynum].checked=true;
    109. currentpos=mynum;
    110. launched=true;
    111.       }
    112.    }
    113. }

    114. function hithead(id) {
    115. if(playing==false) {
    116. clrholes();
    117. display("请点击上面的按钮开始游戏");
    118. return;
    119. }
    120. if(currentpos!=id) {
    121. totalhits+=-1;
    122. document.cpanel.score.value=totalhits;
    123. document.dmz.elements[id].checked=false;
    124. }
    125. else {
    126. totalhits+=1;
    127. document.cpanel.score.value=totalhits;
    128. launch();
    129. document.dmz.elements[id].checked=false;
    130.    }
    131. }

    132. function random() {
    133. return(Math.floor(Math.random()*100%numholes));
    134. }
    135. // End -->
    136. </script>
    137. <center><h2>测试你鼠标点击控制能力</h2></center>
    138. <p align="center">
    139. 30秒内击中下面电脑随机选择的圈圈<br>
    140. 每点中一个加一分,点错一个扣一分<br>
    141. (据说有位CS高手30秒内点中95下,你能吗?)
    142. <form name="cpanel">
    143. <center>
    144. <table cellspacing=3>
    145. <tr>
    146. <td><input type="button" name="startstop" value="开始游戏/结束游戏" onClick="play()"></td>
    147. <td><pre>    </pre></td>
    148. <td align=right>时间:</td>
    149. <td><input type="text" name="timeleft" size="4" onFocus="this.blur()"></td>
    150. </tr>
    151. <tr>
    152. <td>
    153. <input type="text" name="state" value="请单击上面按钮开始游戏!" onFocus="this.blur()" size="23"></td>
    154. <td><pre>    </pre></td>
    155. <td align=right>分数:</td>
    156. <td><input type="text" name="score" size="4" onFocus="this.blur()"></td>
    157. </tr>
    158. </table>
    159. </center>
    160. </form>
    161. <form name="dmz">
    162. <center>
    163. <table cellpadding="2" cellspacing=2>
    164. <tr>
    165. <td colspan=10><hr size=1></td>
    166. </tr>
    167. <tr>
    168. <td><input type="radio" onClick="hithead(0)"></td>
    169. <td><input type="radio" onClick="hithead(1)"></td>
    170. <td><input type="radio" onClick="hithead(2)"></td>
    171. <td><input type="radio" onClick="hithead(3)"></td>
    172. <td><input type="radio" onClick="hithead(4)"></td>
    173. <td><input type="radio" onClick="hithead(5)"></td>
    174. <td><input type="radio" onClick="hithead(6)"></td>
    175. <td><input type="radio" onClick="hithead(7)"></td>
    176. <td><input type="radio" onClick="hithead(8)"></td>
    177. <td><input type="radio" onClick="hithead(9)"></td>
    178. </tr>
    179. <tr>
    180. <td><input type="radio" onClick="hithead(10)"></td>
    181. <td><input type="radio" onClick="hithead(11)"></td>
    182. <td><input type="radio" onClick="hithead(12)"></td>
    183. <td><input type="radio" onClick="hithead(13)"></td>
    184. <td><input type="radio" onClick="hithead(14)"></td>
    185. <td><input type="radio" onClick="hithead(15)"></td>
    186. <td><input type="radio" onClick="hithead(16)"></td>
    187. <td><input type="radio" onClick="hithead(17)"></td>
    188. <td><input type="radio" onClick="hithead(18)"></td>
    189. <td><input type="radio" onClick="hithead(19)"></td>
    190. </tr>
    191. <tr>
    192. <td><input type="radio" onClick="hithead(20)"></td>
    193. <td><input type="radio" onClick="hithead(21)"></td>
    194. <td><input type="radio" onClick="hithead(22)"></td>
    195. <td><input type="radio" onClick="hithead(23)"></td>
    196. <td><input type="radio" onClick="hithead(24)"></td>
    197. <td><input type="radio" onClick="hithead(25)"></td>
    198. <td><input type="radio" onClick="hithead(26)"></td>
    199. <td><input type="radio" onClick="hithead(27)"></td>
    200. <td><input type="radio" onClick="hithead(28)"></td>
    201. <td><input type="radio" onClick="hithead(29)"></td>
    202. </tr>
    203. <tr>
    204. <td><input type="radio" onClick="hithead(30)"></td>
    205. <td><input type="radio" onClick="hithead(31)"></td>
    206. <td><input type="radio" onClick="hithead(32)"></td>
    207. <td><input type="radio" onClick="hithead(33)"></td>
    208. <td><input type="radio" onClick="hithead(34)"></td>
    209. <td><input type="radio" onClick="hithead(35)"></td>
    210. <td><input type="radio" onClick="hithead(36)"></td>
    211. <td><input type="radio" onClick="hithead(37)"></td>
    212. <td><input type="radio" onClick="hithead(38)"></td>
    213. <td><input type="radio" onClick="hithead(39)"></td>
    214. </tr>
    215. <tr>
    216. <td><input type="radio" onClick="hithead(40)"></td>
    217. <td><input type="radio" onClick="hithead(41)"></td>
    218. <td><input type="radio" onClick="hithead(42)"></td>
    219. <td><input type="radio" onClick="hithead(43)"></td>
    220. <td><input type="radio" onClick="hithead(44)"></td>
    221. <td><input type="radio" onClick="hithead(45)"></td>
    222. <td><input type="radio" onClick="hithead(46)"></td>
    223. <td><input type="radio" onClick="hithead(47)"></td>
    224. <td><input type="radio" onClick="hithead(48)"></td>
    225. <td><input type="radio" onClick="hithead(49)"></td>
    226. </tr>
    227. <tr>
    228. <td><input type="radio" onClick="hithead(50)"></td>
    229. <td><input type="radio" onClick="hithead(51)"></td>
    230. <td><input type="radio" onClick="hithead(52)"></td>
    231. <td><input type="radio" onClick="hithead(53)"></td>
    232. <td><input type="radio" onClick="hithead(54)"></td>
    233. <td><input type="radio" onClick="hithead(55)"></td>
    234. <td><input type="radio" onClick="hithead(56)"></td>
    235. <td><input type="radio" onClick="hithead(57)"></td>
    236. <td><input type="radio" onClick="hithead(58)"></td>
    237. <td><input type="radio" onClick="hithead(59)"></td>
    238. </tr>
    239. <tr><td colspan=10 align="center"></td>
    240. </tr></table></center></form>

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

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?创建账号

    ×

    评分

    参与人数 1金钱 +10 收起 理由
    眷恋 + 10 6666

    查看全部评分

  • TA的每日心情
    擦汗
    2018-10-2 10:48
  • 签到天数: 3 天

    连续签到: 2 天

    [LV.2]天邪鬼

     楼主| 发表于 2018-8-30 10:50:02 | 显示全部楼层
    记得选中UTF-8编码哦
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2018-12-9 13:30
  • 签到天数: 22 天

    连续签到: 1 天

    [LV.4]提灯小僧

    发表于 2018-8-30 11:12:33 | 显示全部楼层
    有键盘测试得吗
    回复

    使用道具 举报

  • TA的每日心情
    无聊
    2018-9-3 11:50
  • 签到天数: 6 天

    连续签到: 1 天

    [LV.2]天邪鬼

    发表于 2018-8-30 15:35:20 | 显示全部楼层

    有键盘测试得吗
    回复

    使用道具 举报

  • TA的每日心情
    擦汗
    2021-8-25 14:20
  • 签到天数: 47 天

    连续签到: 1 天

    [LV.5]三尾狐

    发表于 2018-8-30 16:23:49 | 显示全部楼层


    有键盘测试得吗
    回复

    使用道具 举报

  • TA的每日心情

    2022-6-16 11:31
  • 签到天数: 29 天

    连续签到: 1 天

    [LV.4]提灯小僧

    发表于 2018-8-30 19:59:12 | 显示全部楼层
    看来有自学js的必要了
    回复

    使用道具 举报

  • TA的每日心情
    慵懒
    2018-9-14 09:38
  • 签到天数: 20 天

    连续签到: 16 天

    [LV.4]提灯小僧

    发表于 2018-8-31 14:00:53 | 显示全部楼层
    谢谢楼主分享
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2023-11-6 14:48
  • 签到天数: 53 天

    连续签到: 1 天

    [LV.5]三尾狐

    发表于 2018-9-13 13:14:12 | 显示全部楼层
    我30多是不是废了
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 创建账号

    本版积分规则

    Archiver|手机版|小黑屋|iYa.App 软件交流社区

    GMT+8, 2024-4-25 04:58 , Processed in 0.061395 second(s), 21 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表