collinhover / impactplusplus

Impact++ is a collection of additions to ImpactJS with full featured physics, dynamic lighting, UI, abilities, and more.
http://collinhover.github.com/impactplusplus
MIT License
276 stars 59 forks source link

Speed of Player #167

Closed tybeck closed 10 years ago

tybeck commented 10 years ago

How do I increase the base speed of the Player Entity. I'm trying to transition over to Impact++, but my character is moving very slow - whereas it used to be able to run / etc. I tried looking at the documentation, but I can't find anything...

Thanks, Tyler

Pattentrick commented 10 years ago

Hi there @tybeck,

the max "grounded" movement speed of characters (the player is a character by the way) is controlled by the maxVelGrounded values of your entity:

https://github.com/collinhover/impactplusplus/blob/master/lib/plusplus/abstractities/character.js#L133

But frictionGrounded also plays a role. But just set maxVelGrounded to a higher value on your player for a higher max speed. Beware that you can have different max velocities for climbing, grounded, ungrounded movement. You also have corresponding friction for grounded/ungrounded.

If you want to accelerate faster, have a look at the speed property:

https://github.com/collinhover/impactplusplus/blob/master/lib/plusplus/abstractities/character.js#L188

tybeck commented 10 years ago

Ahh thank you,

With more sleep; I noticed that I was looking under "tutorial" section, and didn't notice the "ABSTRACTITIES" API Docs for Character. Sorry about that and thanks!