diff options
author | Luke Bratch <l_bratch@yahoo.co.uk> | 2010-11-26 13:20:09 +0000 |
---|---|---|
committer | Luke Bratch <l_bratch@yahoo.co.uk> | 2010-11-26 13:20:09 +0000 |
commit | 4e986298d51b48a0033c9d0e8a9a32e9a21b3809 (patch) | |
tree | 84c1d95595b831a85b38cadd4cac8e79776fe256 | |
parent | 4718c83d9204a0a9e2e0add143e829bbb9c0bff0 (diff) |
Implement gravity
-rw-r--r-- | Level.cpp | 5 | ||||
-rw-r--r-- | intensemarcus.h | 1 |
2 files changed, 6 insertions, 0 deletions
@@ -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); |