Day 6 of the Level Editor project
I decided that I would make the level scrollable today, so that tiles could be placed outside the first screen. In game.h, we define two new variables unsigned int currentPosX; unsigned int currentPosY; which we set to zero in the Initialize method. These variables will store the current position in the world, where x,y = 0,0 is the bottom-left corner. We need to consider this position whenever we work with coordinates of tiles. So in the Update method, we have to write: case Solid: newElement->coordX0 += currentPosX; newElement->coordX1 += currentPosX; newElement->coordY0 += currentPosY; newElement->coordY1 += currentPosY; level.push_back(newElement); break; and evaluate the keypresses: if (g_keys->keyDown[VK_UP]) { currentPosY++; } if (g_keys->keyDown[VK_DOWN]) { if (currentPosY > 0) currentPosY--; } if (g_keys->keyDown[VK_LEFT]) { if (currentPosX > 0) currentPosX--; } if (g_keys->