javascript 打字游戏实现代码
效果如图所示:下面是核心代码 代码如下:GAME = { //随机产生字母 randLetter: function() { var arrLetter = new Array(“A”, “B”, “C”, “D”, “E”, “F”, “G”, “H”, “I”, “J”, “K”, “L”, “M”, “N”, “O”, “P”, “Q”, “R”, “S”, “T”, “U”, “V”, “W”, “X”, “Y”, “Z”); //随机产生字母 var index = Math.floor(Math.random() * 26); return arrLetter[index]; },
用户评论