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

Shift to sprint? #29

Open
andrewgrider opened this issue Apr 6, 2018 · 2 comments
Open

Shift to sprint? #29

andrewgrider opened this issue Apr 6, 2018 · 2 comments

Comments

@andrewgrider
Copy link

Could you add a shift to sprint funciton? I looked at the code but I don't know how to control the player's speed

@ficopang
Copy link

ficopang commented Apr 7, 2018

add
var running = this.keys[16];
to player.js before // Walking
and add
if(running)
{
velocity.x *= 1.4;
velocity.y *= 1.4;
}
inside
if ( walkVelocity.length() > 0 ) {

@andrewgrider
Copy link
Author

Yes I found this out yesterday, I added a toggleSprint function that is toggled using the shiftKey but thanks!

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

No branches or pull requests

2 participants