Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sprint Functionality #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add Sprint Functionality #86

wants to merge 2 commits into from

Conversation

kk6axq
Copy link

@kk6axq kk6axq commented Nov 9, 2017

Add the ability for the player to sprint at 10 speed by holding left shift.

main.py Outdated
@@ -450,6 +451,9 @@ def __init__(self, *args, **kwargs):
# right, and 0 otherwise.
self.strafe = [0, 0]

#True if sprinting
self.sprinting = False

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use spaces instead of tabs?

main.py Outdated
elif self.sprinting:
speed = SPRINTING_SPEED
else:
speed = WALKING_SPEED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

main.py Outdated
@@ -733,6 +742,9 @@ def on_key_press(self, symbol, modifiers):
self.set_exclusive_mouse(False)
elif symbol == key.TAB:
self.flying = not self.flying
elif symbol == key.LSHIFT:
self.sprinting = True
print "Sprinting"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line (or use print("Sprinting") to work on Python 3)

@kk6axq
Copy link
Author

kk6axq commented Nov 15, 2017

Fixed, thanks for the input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants