diff options
author | Luke Bratch <l_bratch@yahoo.co.uk> | 2010-11-27 23:21:41 +0000 |
---|---|---|
committer | Luke Bratch <l_bratch@yahoo.co.uk> | 2010-11-27 23:21:41 +0000 |
commit | a00e29799a9fa4e8f140ef3f292f3200736fe957 (patch) | |
tree | 1291f705df69dd0bab04ea03f033a59634701d51 | |
parent | a8b7a90a5886054de083b8c82300fbbfc198fa5a (diff) |
Level: Scroll when near, rather than at, the right edge of the screen
-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(); } |