-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: master
Are you sure you want to change the base?
Conversation
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 | |||
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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)
Fixed, thanks for the input! |
Add the ability for the player to sprint at 10 speed by holding left shift.