Using Array for keeping track of rows and columns
<p>I am loading my level for a game  through xml.</p>

<p>I have a loop that test the "name" and adds the sprite accordingly. </p>

<p>I have a map that has tiles that are 80by80 width and height. The maps rows and columns are 6x10.</p>

<p>I am trying to find a way to keep track of which row and column the level loader is on while it is loading the tiles, because i want to do specific things with the coordinates.</p>

<p>I have thought of using a 2d array for this but i am not sure how i would go about doing this in this situation.</p>

<p>Could anyone help me out with this?</p>

<p>EDIT:</p>

<p>Here is what i have tried.</p>

<p>Creating a row and column array</p>

<pre><code> int row[] = new int[6];
 int col[] = new int[10];
</code></pre>

<p>Now here is where i am stuck, im not sure how i can tell the code when to switch and use a different row. For example..</p>

<pre><code>if (name.equals(TAG_ENTITY_ATTRIBUTE_TYPE_unwalkable)) {
    tile = new Tile(x, y, this.tUnwalkable_tile,
            activity.getVertexBufferObjectManager());
    tileList.add(tile);
    tile.setTag(1);

    /*
     * Body groundBody = PhysicsFactory.createBoxBody(this.mPhysicsWorld,
     * tile, BodyType.StaticBody, wallFixtureDef);
     */
    gameScene.getChildByIndex(SECOND_LAYER).attachChild(tile);
    Log.e("Tile", "Unwalkable_Tile");
    return;
} else if (name.equals(TAG_ENTITY_ATTRIBUTE_TYPE_Blue_Tile)) {
    tile = new Tile(x, y, this.blue,
            activity.getVertexBufferObjectManager());
    tile.setTag(0);
    this.tileList.add(tile);
    gameScene.getChildByIndex(SECOND_LAYER).attachChild(tile);
    return;

} else if (name.equals(TAG_ENTITY_ATTRIBUTE_TYPE_Red_Tile)) {
    tile = new Tile(x, y, this.red, activity.getVertexBufferObjectManager());
    tileList.add(tile);
    tile.setTag(0);
    gameScene.getChildByIndex(SECOND_LAYER).attachChild(tile);
    return;
} else if (name.equals(TAG_ENTITY_ATTRIBUTE_TYPE_Pink_Tile)) {
    tile = new Tile(x, y, this.pink,
            activity.getVertexBufferObjectManager());
    tileList.add(tile);
    tile.setTag(0);
    gameScene.getChildByIndex(SECOND_LAYER).attachChild(tile);
    return;
} else if (name.equals(TAG_ENTITY_ATTRIBUTE_TYPE_Yello_Tile)) {
    tile = new Tile(x, y, this.yellow,
            activity.getVertexBufferObjectManager());
    tileList.add(tile);
    tile.setTag(0);
    gameScene.getChildByIndex(SECOND_LAYER).attachChild(tile);
    return;

    }
</code></pre>

<p>How do i tell it to stay row[1] until the col[10] is reached? </p>

<p>Then switch to row[2] and stay there until col[10] is reached again? </p>
