summaryrefslogtreecommitdiff
path: root/Level.cpp
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2010-11-25 20:35:18 +0000
committerLuke Bratch <l_bratch@yahoo.co.uk>2010-11-25 20:35:18 +0000
commit413302330666a135389b759139ff9d5b6eb20052 (patch)
tree15cbb0a0651417871d8d20033227339553f4ec3c /Level.cpp
parent71926d883a678be983a434f8c0da435178d7585d (diff)
Add background to Level, add sample background, modify Screen::blit() to always blit
onto the game window
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);
}