日期:2014-05-16  浏览次数:20430 次

新人求教setInterval问题
我写的一个打字游戏为什么setInterval不能执行move方法呢?
代码如下:
HTMLCode:
<html>
<head>
    <title>打字</title>
    <link type="text/css" href="./css/objMain.css" rel="stylesheet">
    <script src="./js/objClickWords.js"></script>
</head>
<body onkeypress="makeWordFromKeyBoard()">
   <div id="outer">
      <div id="inner_top">
            <!--主显示区域即字母下降区域-->
      </div>
      <div id="inner_bottom">
        <!--状态和控制面板区域-->
      分数:<span id="cores">0</span>
  難度:<select onchange="changeGameLevel()" id="hard">
<option value="700">7</option>
<option value="600">6</option>
<option value="500">5</option>
<option value="400">4</option>
<option value="300">3</option>
<option value="200">2</option>
<option value="100">1</option>
       </select>
 运行状态:<span id="run_status">停止中.......</span>
         <button onclick="startGameFromKeyBoard()">begin</button>
 <button onclick="pauseGame()">pause</button>
      </div>
   </div>
</body>
</html>
jsCode:
//盒子或容器
function Box(boxId,boxName){
   var B_this=this;
   B_this.id=boxId;
   B_this.bName=boxName;
   B_this.boxSize;//容器大小
   B_this.isExist=false;//盒子是否在引擎上
   B_this.htmlNodeObj;
   {
//alert("999");
     if(B_this.id==null||B_this.id==undefined){
    alert("盒子参数未初始化1!");
return;
 }
 if(B_this.bName==null||B_this.bName==undefined){
      alert("盒子参数未初始化2!");
  return;
 }
     B_this.htmlNodeObj=document.createElement("label");
     B_this.htmlNodeObj.id=B_this.id;
         B_this.htmlNodeObj.innerHTML=String.fromCharCode(B_this.bName); 
 B_this.htmlNodeObj.style.position="absolute";
         B_this.htmlNodeObj.style.top=0+"px";
   }
   B_this.getHtmlNodeObj=function(){//获得label节点对象
      return B_this.htmlNodeObj;
   }
   B_this.setBName=function(bxName){//为盒子命名
      B_this.bName=bxName;
   }
   B_this.getBName=function(){//获得盒子的名字
      return B_this.bName;
   }
   B_this.setId=function(bId){//给盒子一个id
     B_this.id=bId;
   }
   B_this.getId=function(){//获得盒子的id
      return B_this.id;
   }
   B_this