From 413302330666a135389b759139ff9d5b6eb20052 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Thu, 25 Nov 2010 20:35:18 +0000 Subject: Add background to Level, add sample background, modify Screen::blit() to always blit onto the game window --- Level.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Level.cpp') 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); } -- cgit v1.2.3