我收到错误:
“'game.Form1.WallCheckerArray' 和 'game.Form1.WallCheckerArray' 之间的歧义”
因为我用了两次。为什么我不能使用不同的值两次使用相同的数组名称?我的代码如下。该数组存在坐标之外。
我的数组:
private int[,] WallCheckerArray = new int[28, 4];// <<----- was the problem
int[,] WallCheckerArray = {
{220,250,13,64},//1
{24,58,24,55},//2
{104,206,22,55},//3
{264,370,22,55},//4
{382,450,22,55},//5
{24,92,74,109},//6
{104,136,74,185},//7
{136,206,114,138},//8
{150,326,74,98},//9
{225,255,98,140},//10
{345,365,74,185},//11
{275,355,114,138},//12
{384,445,74,109},//13
{104,136,200,270},//14
{150,330,240,270},//15
{225,255,270,315},//16
{340,370,200,270},//17
{20,85,285,305},//18
{50,85,305,345},//19
{104,214,285,315},//20
{274,368,285,315},//21
{378,445,285,305},//22
{378,415,305,345},//23
{24,195,365,375},//24
{104,154,335,375},//25
{165,339,335,345},//26
{215,245,335,375},//27
{265,445,365,375},//28
{355,365,335,375}//29
};
int i = 0;
for( i = 0; i < 29; i++)
{
if (((x >= WallCheckerArray[i, 0] && x <= WallCheckerArray[i, 1]) && (y >= WallCheckerArray[i, 2] && y <= WallCheckerArray[i, 3])))//-----------------------------------}-
{
InsideWC();
System.Console.WriteLine(WallCheckerArray[i, 1]);
}
}