Overv / WebCraft

Minecraft clone written in Javascript.
zlib License
386 stars 179 forks source link

Shift to sprint? #29

Open andrewgrider opened 6 years ago

andrewgrider commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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