If you are meaning that the top row is offset from the other rows you need to change
This :
void Level::DrawTiles()
{
cout << tileIds[0] << endl;
cout << tileIds[1] << endl;
float height = 400.f;
//float height = 0.f;
float width = 0.f;
//int i = 0;
numOfTileSprites = 0;
for(int r = 0; r < MAX_TILES; r++)
{
for(int c = 0; c < MAX_TILES; c++)
{
if(tileMap[r][c] != tileIds[0])
{
tileSprites[numOfTileSprites] = agk::CreateSprite(tileMap[r][c]);
agk::SetSpriteScale(tileSprites[numOfTileSprites], SCALE, SCALE);
agk::SetSpritePhysicsOn(tileSprites[numOfTileSprites], 1);
//agk::SetSpriteGroup(tileSprites[numOfTileSprites], 1);
//agk::SetSpritePhysicsMass(tileSprites[numOfTileSprites], 100.f);
//agk::FixSpriteToScreen(tileSprites[numOfTileSprites], 1);
agk::SetSpritePosition(tileSprites[numOfTileSprites], width, height);
}
width += (16.f * SCALE);
//i++;
numOfTileSprites++;
}
height += (16.f * SCALE);
width = 100.f;
}
}
To this:
void Level::DrawTiles()
{
cout << tileIds[0] << endl;
cout << tileIds[1] << endl;
float height = 400.f;
//float height = 0.f;
float width = 0.f;
//int i = 0;
numOfTileSprites = 0;
for(int r = 0; r < MAX_TILES; r++)
{
for(int c = 0; c < MAX_TILES; c++)
{
if(tileMap[r][c] != tileIds[0])
{
tileSprites[numOfTileSprites] = agk::CreateSprite(tileMap[r][c]);
agk::SetSpriteScale(tileSprites[numOfTileSprites], SCALE, SCALE);
agk::SetSpritePhysicsOn(tileSprites[numOfTileSprites], 1);
//agk::SetSpriteGroup(tileSprites[numOfTileSprites], 1);
//agk::SetSpritePhysicsMass(tileSprites[numOfTileSprites], 100.f);
//agk::FixSpriteToScreen(tileSprites[numOfTileSprites], 1);
agk::SetSpritePosition(tileSprites[numOfTileSprites], width, height);
}
width += (16.f * SCALE);
//i++;
numOfTileSprites++;
}
height += (16.f * SCALE);
width = 0.0f;
}
}