我的一段代码有问题,它似乎在下面的这个类中:
package
{
import flash.display.MovieClip;
//levels are 11x9
public class Level extends MovieClip
{
var level1:Array=new Array(
1,1,1,1,1,1,1,1,1,1,1,
1,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,1,
1,0,0,1,0,0,0,0,0,0,1,
1,0,0,1,1,1,0,0,0,1,1,
1,0,0,0,0,0,0,1,1,0,1,
1,1,1,1,1,1,1,1,1,1,1);
var grid:Array = new Array(11);
public function Level()
{
for (var i = 0; i < 9; i++)
{
grid.push(new Array(9));
}
for (var xr=0; xr<11; xr++)
{
for (var yr=0; yr<9; yr++)
{
var type = level1[yr * 11 + xr];
var obj:Wall = new Wall(xr*50,yr*50,type);
grid[xr][yr] = obj;
if (type!=0)
{
addChild(obj);
}
}
}
}
}
}
现在我做了一些工作,错误是错误代码#1010:术语未定义并且没有属性。更具体地说,我做了一些调试并确定了确切的行是 grid[xr][yr]=obj; 任何帮助表示赞赏。在此处输入代码 在此处输入代码