diff options
author | Luke Bratch <l_bratch@yahoo.co.uk> | 2010-11-25 20:35:18 +0000 |
---|---|---|
committer | Luke Bratch <l_bratch@yahoo.co.uk> | 2010-11-25 20:35:18 +0000 |
commit | 413302330666a135389b759139ff9d5b6eb20052 (patch) | |
tree | 15cbb0a0651417871d8d20033227339553f4ec3c /Level.cpp | |
parent | 71926d883a678be983a434f8c0da435178d7585d (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.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); } |