summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2010-12-03 12:23:41 +0000
committerLuke Bratch <l_bratch@yahoo.co.uk>2010-12-03 12:23:41 +0000
commitbc01a352740c34e5f2f83efbee14e0bc9ef28ba5 (patch)
tree18fd777af7948a3caecc1c63b8a2173a0ad5d4bc /main.cpp
parent2822267d7b38756af7a27e7169c08dddca4f3a2c (diff)
Implement sprinting
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 4b22a5d..357edc4 100644
--- a/main.cpp
+++ b/main.cpp
@@ -45,6 +45,10 @@ int main(int argc, char* args[]) {
case SDLK_UP:
level.player.jump();
break;
+ case SDLK_LCTRL:
+ level.player.setSprint(true);
+ std::cout << "Running...\n";
+ break;
}
} else if (event.type == SDL_KEYUP) {
// Adjust player velocity
@@ -55,6 +59,10 @@ int main(int argc, char* args[]) {
case SDLK_RIGHT:
level.player.incXVel(-MOVE_AMOUNT);
break;
+ case SDLK_LCTRL:
+ level.player.setSprint(false);
+ std::cout << "Stop running.\n";
+ break;
}
}