summaryrefslogtreecommitdiff
path: root/Level.cpp
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2010-11-25 21:12:09 +0000
committerLuke Bratch <l_bratch@yahoo.co.uk>2010-11-25 21:12:09 +0000
commit5dd6f1089a86e69889056f3853b373025f68026f (patch)
treebc57a4191d0ea1f0ef25c9d357761bde9fba779b /Level.cpp
parentfd98c5d4687f4721826e78a626fead8bec7ac98b (diff)
Add a marcus sprite sheet, set it as the player's image, implement left/right keyboard
input
Diffstat (limited to 'Level.cpp')
-rw-r--r--Level.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Level.cpp b/Level.cpp
index 0dec3ef..6c0f80c 100644
--- a/Level.cpp
+++ b/Level.cpp
@@ -29,14 +29,18 @@ void Level::changeLevel(int levelNo) {
// Load background image
if (!(background = loadImage("space.png")))
std::cout << "Level::changeLevel: Error loading background image.\n";
+
+ // Make player into a Marcus
+ player.setImage("marcussheet.png");
}
void Level::move() {
- //std::cout << "Level::move(): Moving level items.\n";
+ player.setX(player.getX() + player.getXVel());
}
void Level::draw(Screen *screen) {
- //std::cout << "Level::draw(): Drawing into the screen.\n";
// Blit background
screen->blit(0, 0, background);
+
+ screen->blit(player.getX(), player.getY(), player.image);
}