summaryrefslogtreecommitdiff
path: root/Player.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 /Player.cpp
parent2822267d7b38756af7a27e7169c08dddca4f3a2c (diff)
Implement sprinting
Diffstat (limited to 'Player.cpp')
-rw-r--r--Player.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Player.cpp b/Player.cpp
index fcc626d..d5288ce 100644
--- a/Player.cpp
+++ b/Player.cpp
@@ -3,6 +3,7 @@
Player::Player() {
health = 100;
+ sprint = false;
}
void Player::jump() {
@@ -16,3 +17,18 @@ void Player::kill() {
health = 0;
// Do resetting stuff
}
+
+void Player::setSprint(bool s) {
+ sprint = s;
+}
+
+bool Player::getSprint() {
+ return sprint;
+}
+
+int Player::getXVel() {
+ if (sprint)
+ return xVel * SPRINT_MULTIPLYER;
+ else
+ return xVel;
+}