diff options
-rw-r--r-- | Level.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -60,7 +60,7 @@ void Level::move() { } } - if (rect.x >= 0 && rect.x <= SCREEN_WIDTH - rect.w) { + if (rect.x >= 0 && rect.x <= SCREEN_WIDTH - rect.w - 32) { player.setX(rect.x); } @@ -92,7 +92,8 @@ void Level::draw(Screen *screen) { screen->blit(player.getX(), player.getY(), player.image, player.getClip()); // Scroll level - if (player.getX() == 0 || player.getX() >= SCREEN_WIDTH - player.getClip()->w - MOVE_AMOUNT) { + if (player.getX() == 0 || player.getX() >= SCREEN_WIDTH + - player.getClip()->w - 32 - MOVE_AMOUNT) { if (player.getXVel() < 0 || player.getXVel() > 0) cameraX -= player.getXVel(); } |