summaryrefslogtreecommitdiff
path: root/Level.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Level.cpp')
-rw-r--r--Level.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Level.cpp b/Level.cpp
index 27a77be..0dec3ef 100644
--- a/Level.cpp
+++ b/Level.cpp
@@ -25,6 +25,10 @@ void Level::changeLevel(int levelNo) {
// Checking where the player is for fun/demonstration purposes
std::cout << "Level::changeLevel(): player is at " << player.getX() << ", " << player.getY() << ".\n";
+
+ // Load background image
+ if (!(background = loadImage("space.png")))
+ std::cout << "Level::changeLevel: Error loading background image.\n";
}
void Level::move() {
@@ -33,4 +37,6 @@ void Level::move() {
void Level::draw(Screen *screen) {
//std::cout << "Level::draw(): Drawing into the screen.\n";
+ // Blit background
+ screen->blit(0, 0, background);
}