gamewithsound.html 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. a {
  5. text-decoration:none;
  6. color:white;
  7. }
  8. a:visited {
  9. text-decoration:none;
  10. color:white;
  11. }
  12. body {
  13. margin: 0 0 0 0;
  14. }
  15. #audioPlayer {
  16. margin: 0;
  17. padding: 0;
  18. }
  19. a.external:link {
  20. text-decoration: underline;
  21. color: blue;
  22. }
  23. .error {
  24. /* color: #660000;*/
  25. font-weight: bold;
  26. text-align: left;
  27. padding: 0 100px 0 100px;
  28. }
  29. </style>
  30. <script language="javascript">
  31. function playSound(soundName) {
  32. var audioPlayer = document.getElementById('audioPlayer');
  33. audioPlayer.playSound(soundName);
  34. }
  35. var p = new Array();
  36. var po = new Array();
  37. var picData = new Array(0,1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800,9,900,10,1000,11,1100,12,1200);
  38. var picInfo = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  39. function preload(imgName, imgSrc) {
  40. if (document.images) {
  41. eval(imgName + ' = new Image()')
  42. eval(imgName+'.src = "'+imgSrc+'"')
  43. }
  44. }
  45. preload ('p1', 'shibd.gif');
  46. preload ('p2', 'bibd.gif');
  47. preload ('p3', 'shubd.gif');
  48. preload ('p4', 'zhebd.gif');
  49. preload ('p5', 'wobd.gif');
  50. preload ('p6', 'ta2bd.gif');
  51. preload ('p7', 'mabd.gif');
  52. preload ('p8', 'nibd.gif');
  53. preload ('p9', 'ta3bd.gif');
  54. preload ('p10', 'ta1bd.gif');
  55. preload ('p11', 'na3bd.gif');
  56. preload ('p12', 'dabd.gif');
  57. preload ('p100', 'shibd1.gif');
  58. preload ('p200', 'bibd1.gif');
  59. preload ('p300', 'shubd1.gif');
  60. preload ('p400', 'zhebd1.gif');
  61. preload ('p500', 'wobd1.gif');
  62. preload ('p600', 'ta2bd1.gif');
  63. preload ('p700', 'mabd1.gif');
  64. preload ('p800', 'nibd1.gif');
  65. preload ('p900', 'ta3bd1.gif');
  66. preload ('p1000', 'ta1bd1.gif');
  67. preload ('p1100', 'na3bd1.gif');
  68. preload ('p1200', 'dabd1.gif');
  69. preload ('blankdot', 'blankdot.gif');
  70. var y;
  71. var temp;
  72. for (x=1; x<=24; x++){
  73. y = Math.round(Math.random()*(24-1))+1;
  74. temp = picData[x];
  75. picData[x] = picData[y];
  76. picData[y] = temp;
  77. }
  78. var temp1=0;
  79. var index1=0;
  80. var counter=0
  81. var condition =0;
  82. var s1;
  83. var s2;
  84. var rem;
  85. var ready = true;
  86. var soundindex = "sound12";
  87. var game_start = false;
  88. function checkit(x){
  89. if (game_start == false){
  90. tellTime();
  91. game_start = true;
  92. }
  93. if (picData[x]>=100)
  94. playSound("sound" + picData[x] / 100);
  95. else
  96. playSound("sound" + picData[x]);
  97. if (picInfo[x]== 0 && ready==true){
  98. if (temp1==0){
  99. temp1 = picData[x];
  100. eval("document.pic" + x + ".src = p" + temp1 + ".src;");
  101. index1 = x;
  102. }
  103. else{
  104. if (index1 != x){
  105. if (picData[x] == temp1 * 100 || picData[x] == temp1/100){
  106. eval("document.pic" + x + ".src = p" + picData[x] + ".src;");
  107. eval("document.pic" + index1 + ".src = p" + temp1 + ".src;");
  108. temp1 = 0;
  109. picInfo[index1] = 1;
  110. picInfo[x] = 1;
  111. counter++;
  112. }
  113. else{
  114. temp1 = 0;
  115. rem = x;
  116. condition = 0;
  117. delay();
  118. }
  119. }
  120. }
  121. if (counter == 12){
  122. if (h==0 && m<10)
  123. alert("Great! \n" +hinfo + minfo + sinfo);
  124. else
  125. alert("Good! \n" +hinfo + minfo + sinfo);
  126. ready = false;
  127. timeCondition = false;
  128. }
  129. }
  130. }
  131. function delay(){
  132. if (condition == 0){
  133. eval("document.pic" + rem + ".src = p" + picData[rem] + ".src;");
  134. condition = 1;
  135. ready = false;
  136. setTimeout("delay()", 300);
  137. }
  138. else{
  139. eval("document.pic" + rem + ".src = blankdot.src;");
  140. eval("document.pic" + index1 + ".src=blankdot.src;");
  141. ready = true;
  142. }
  143. }
  144. </script>
  145. </head>
  146. <body marginwidth="0" marginheight="0" onResize="window.location.href = window.location.href;">
  147. <table CELLPADDING="0" CELLSPACING="0" BORDER="0" border="0" bgcolor="#330099" height="8">
  148. <tr>
  149. <td NOWRAP="1" VALIGN=CENTER bgcolor="#330099">&nbsp;&nbsp;<font face="Verdana,Arial,Helvetica" size="1"><a href="../../welcome.html">Home </a></font>&nbsp;&nbsp;<font size+1><font color="#FFFFFF">|</font></font></td>
  150. <td NOWRAP="1" bgcolor="#330099">&nbsp;&nbsp;<font face="Verdana,Arial,Helvetica" size="1"><a href="../../../China/china.html">China Index</a></font>&nbsp;&nbsp;<font size+1><font color="#FFFFFF">|</font></font></td>
  151. <td NOWRAP="1" bgcolor="#330099">&nbsp;&nbsp;<font face="Verdana,Arial,Helvetica" size="1"><a href="../../topics/topics.html">Topics </a></font>&nbsp;&nbsp;<font size+1><font color="#FFFFFF">|</font></font></td>
  152. <td NOWRAP="1" bgcolor="#330099">&nbsp;&nbsp;<font face="Verdana,Arial,Helvetica" size="1"><a
  153. href="../games.html">Games</a></font>&nbsp;&nbsp;<font size+1><font color="#FFFFFF">|</font></font></td>
  154. <td NOWRAP="1" bgcolor="#330099">&nbsp;&nbsp;<font face="Verdana,Arial,Helvetica" size="1" color="#CCCC00">Characters </font>&nbsp;&nbsp;<font size+1></font></td>
  155. </tr>
  156. </table>
  157. <center>
  158. <p><b><font face="Verdana"><font color="#000099"><font size=-2>Patience please. Wait until the web page finishes loading before you click on the game.<br>
  159. You can continue to play off-line as long as your web browser is open.<br>Hit "Reload" on your browser to play again.</font></font></font></b></p>
  160. <p><b><i><font face="Times New Roman,Times"><font color="#006600"><font size=+1>Enjoy!!!</font></font></font></i></b></p>
  161. <applet code="MultiAudioPlay.class" id="audioPlayer" height="1" width="1">
  162. <param name="image" value="appletsuccessicon.png">
  163. <param name="audio" value="sound1: gamesound/62jz.wav,
  164. sound2: gamesound/48mz.wav,
  165. sound3: gamesound/69jz.wav,
  166. sound4: gamesound/61lyz.wav,
  167. sound5: gamesound/16lz.wav,
  168. sound6: gamesound/54lz.wav,
  169. sound7: gamesound/88gmj.wav,
  170. sound8: gamesound/14am.wav,
  171. sound9: gamesound/81cpa.wav,
  172. sound10: gamesound/1359jz.wav,
  173. sound11: gamesound/94am.wav,
  174. sound12: gamesound/342ls.wav">
  175. <p class="error">ERROR: Applet not displayed. JavaScript and Java 1.4.2 or later are required for this game to work. Visit the <a href="http://www.java.com/" title="Java Software Website" class="external">Java Software Website</a> to check if Java is installed on your computer or try enabling <em>ActiveX</em> if you are an Internet Explorer user.</p>
  176. </applet>
  177. <table border=1 BGCOLOR="#CC0033" >
  178. <tr>
  179. <td><a href="javascript:checkit(1)"><img src="blankdot.gif" border=0 name="pic1" width=64 height=64></a></td>
  180. <td><a href="javascript:checkit(2)"><img src="blankdot.gif" border=0 name="pic2" width=64 height=64></a></td>
  181. <td><a href="javascript:checkit(3)"><img src="blankdot.gif" border=0 name="pic3" width=64 height=64></a></td>
  182. <td><a href="javascript:checkit(4)"><img src="blankdot.gif" border=0 name="pic4" width=64 height=64></a></td>
  183. <td><a href="javascript:checkit(5)"><img src="blankdot.gif" border=0 name="pic5" width=64 height=64></a></td>
  184. </tr>
  185. <tr>
  186. <td><a href="javascript:checkit(6)"><img src="blankdot.gif" border=0 name="pic6" width=64 height=64></a></td>
  187. <td><a href="javascript:checkit(7)"><img src="blankdot.gif" border=0 name="pic7" width=64 height=64></a></td>
  188. <td><a href="javascript:checkit(8)"><img src="blankdot.gif" border=0 name="pic8" width=64 height=64></a></td>
  189. <td><a href="javascript:checkit(9)"><img src="blankdot.gif" border=0 name="pic9" width=64 height=64></a></td>
  190. <td><a href="javascript:checkit(10)"><img src="blankdot.gif" border=0 name="pic10" width=64 height=64></a></td>
  191. </tr>
  192. <tr>
  193. <td><a href="javascript:checkit(11)"><img src="blankdot.gif" border=0 name="pic11" width=64 height=64></a></td>
  194. <td><a href="javascript:checkit(12)"><img src="blankdot.gif" border=0 name="pic12" width=64 height=64></a></td>
  195. <td><img src="gong-copy2.gif" border=0 width=64 height=64></td>
  196. <td><a href="javascript:checkit(13)"><img src="blankdot.gif" border=0 name="pic13" width=64 height=64></a></td>
  197. <td><a href="javascript:checkit(14)"><img src="blankdot.gif" border=0 name="pic14" width=64 height=64></a></td>
  198. </tr>
  199. <tr>
  200. <td><a href="javascript:checkit(15)"><img src="blankdot.gif" border=0 name="pic15" width=64 height=64></a></td>
  201. <td><a href="javascript:checkit(16)"><img src="blankdot.gif" border=0 name="pic16" width=64 height=64></a></td>
  202. <td><a href="javascript:checkit(17)"><img src="blankdot.gif" border=0 name="pic17" width=64 height=64></a></td>
  203. <td><a href="javascript:checkit(18)"><img src="blankdot.gif" border=0 name="pic18" width=64 height=64></a></td>
  204. <td><a href="javascript:checkit(19)"><img src="blankdot.gif" border=0 name="pic19" width=64 height=64></a></td>
  205. </tr>
  206. <tr>
  207. <td><a href="javascript:checkit(20)"><img src="blankdot.gif" border=0 name="pic20" width=64 height=64></a></td>
  208. <td><a href="javascript:checkit(21)"><img src="blankdot.gif" border=0 name="pic21" width=64 height=64></a></td>
  209. <td><a href="javascript:checkit(22)"><img src="blankdot.gif" border=0 name="pic22" width=64 height=64></a></td>
  210. <td><a href="javascript:checkit(23)"><img src="blankdot.gif" border=0 name="pic23" width=64 height=64></a></td>
  211. <td><a href="javascript:checkit(24)"><img src="blankdot.gif" border=0 name="pic24" width=64 height=64></a></td>
  212. </tr>
  213. </table>
  214. </center>
  215. <script language="javascript">
  216. var h=0;
  217. var hinfo = "";
  218. var m=0;
  219. var minfo = "";
  220. var s=-1;
  221. var sinfo = "";
  222. var timeCondition = true;
  223. function tellTime(){
  224. s++;
  225. if (s>=60){
  226. s = 0;
  227. m++;
  228. }
  229. else{
  230. if (s<=1)
  231. eval("sinfo = '" + s + " second'");
  232. else
  233. eval("sinfo = '" + s + " seconds'");
  234. }
  235. if (m>=60){
  236. m = 0;
  237. h++;
  238. }
  239. else{
  240. if (m<=1)
  241. eval("minfo = '" + m + " minute '");
  242. else
  243. eval("minfo = '" + m + " minutes '");
  244. }
  245. if (h<=1)
  246. eval("hinfo = '" + h + " hour '");
  247. else
  248. eval("hinfo = '" + h + " hours '");
  249. window.status = hinfo + minfo + sinfo;
  250. if (timeCondition == true)
  251. setTimeout("tellTime()", 1000);
  252. }
  253. </script>
  254. </body>
  255. </html>