summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2010-11-27 23:02:00 +0000
committerLuke Bratch <l_bratch@yahoo.co.uk>2010-11-27 23:02:00 +0000
commit9d69ea0b61b8c9147997874a7226f1abe99c4ed7 (patch)
treec8852446585ed8003ddca25c5422f7258eeeec8a
parentd6d9743cd32f967efe9e66fa47513d13e315e0b8 (diff)
Level: Don't use MARCUS_WIDTH constant when we can calculate it dynamically
-rw-r--r--Level.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Level.cpp b/Level.cpp
index 1f2b739..c4da3b2 100644
--- a/Level.cpp
+++ b/Level.cpp
@@ -100,7 +100,7 @@ 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 - MARCUS_WIDTH - MOVE_AMOUNT) {
+ if (player.getX() == 0 || player.getX() >= SCREEN_WIDTH - player.getClip()->w - MOVE_AMOUNT) {
if (player.getXVel() < 0 || player.getXVel() > 0)
cameraX -= player.getXVel();
}