I'm going to make a platform jumping game with C# and XNA. I was going to do the levels with arrays, but noticed I can't find any way to refer to the cordinates of members.

Like, if I had a array 0 0
1 1
and I need to say

foreach(0 in array)
{
location=new vector2(x,y);
}

how can I get x and y?

Use nested for loops instead of foreach.

MyData[,] dataArray = new MyData[3, 5];
for (int x = 0; x < dataArray.GetLength(0); x++)
{
    for (int y = 0; y < dataArray.GetLength(1); y++)
    {
        MyData dataItem = dataArray[x, y];
        // do something with dataItem
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.