summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Level.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Level.cpp b/Level.cpp
index 54fd8c6..b5ede51 100644
--- a/Level.cpp
+++ b/Level.cpp
@@ -92,6 +92,14 @@ void Level::move() {
player.setY(rect.y);
+ // Kill the player if they fall off the screen
+ if (player.getY() > SCREEN_HEIGHT) {
+ player.kill();
+ player.setX(startX);
+ player.setY(startY);
+ cameraX = 0;
+ }
+
player.orient();
}