summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Level.cpp5
-rw-r--r--intensemarcus.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/Level.cpp b/Level.cpp
index 8268af8..f704c79 100644
--- a/Level.cpp
+++ b/Level.cpp
@@ -39,8 +39,13 @@ void Level::changeLevel(int levelNo) {
}
void Level::move() {
+ // Apply gravity
+ player.incYVel(GRAVITY);
+
// Player movements
player.setX(player.getX() + player.getXVel());
+ player.setY(player.getY() + player.getYVel());
+
player.orient();
}
diff --git a/intensemarcus.h b/intensemarcus.h
index 45bc78c..8386411 100644
--- a/intensemarcus.h
+++ b/intensemarcus.h
@@ -15,6 +15,7 @@ const int ORIENT_FRONT = 0;
const int ORIENT_BACK = 1;
const int ORIENT_RIGHT = 2;
const int ORIENT_LEFT = 3;
+const int GRAVITY = 3;
SDL_Surface *loadImage(std::string filename);