Level::Level(DrawEngine *de, int w, int h)
{
drawArea = de;
width = w;
height = h;
player = 0;
// char** create memory for every position in the level.
level = new char *[width];
for (int x = 0; x < width; x++)
level[x] = new char[height];
//create the level
createLevel();
drawArea->setMap(level);
}
void DrawEngine::drawBackground(void)
{
if (map)
{
for (int y = 0; y < screenHeight; y++)
{
gotoxy(0, y);
for (int x = 0; x < screenWidth; x++)
cout << tileImage[map[x][y]];
}
}
}