diff options
-rw-r--r-- | Level.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -96,8 +96,12 @@ void Level::move() { } void Level::draw(Screen *screen) { + int x = cameraX + * (SCREEN_WIDTH - background->w) + / (SCREEN_WIDTH - MAP_X*50); + int y = SCREEN_HEIGHT - background->h; // Blit background - screen->blit(0, 0, background); + screen->blit(x, y, background); // If player is in the middle of the screen ... if (player.getX() + cameraX > SCREEN_WIDTH / 2 - player.getClip()->w / 2 + player.getXVel() |