summaryrefslogtreecommitdiff
path: root/Level.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Level.cpp')
-rw-r--r--Level.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/Level.cpp b/Level.cpp
index c4da3b2..a787e94 100644
--- a/Level.cpp
+++ b/Level.cpp
@@ -20,13 +20,6 @@ void Level::changeLevel(int levelNo) {
Hazard hazard1;
Platform platform1;
- // Placing the player for fun/demonstration purposes
- player.setX(0);
- player.setY(0);
-
- // 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";
@@ -151,6 +144,10 @@ void Level::loadMap(int LevelNo) {
platform[numPlatforms].setClip(0, TILE_SIZE * (type - 1), 0, TILE_SIZE, TILE_SIZE);
numPlatforms++;
+ } else if (type == 'P') {
+ // Set the player starting position
+ player.setX((i % MAP_X) * TILE_SIZE);
+ player.setY((i / MAP_X) * TILE_SIZE - player.getClip()->h);
}
}