From bc01a352740c34e5f2f83efbee14e0bc9ef28ba5 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Fri, 3 Dec 2010 12:23:41 +0000 Subject: Implement sprinting --- main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'main.cpp') 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; } } -- cgit v1.2.3