The Wayback Machine - https://web.archive.org/web/20200707162524/https://github.com/shakiba/planck.js/issues/110
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

Help with the car example #110

Open
SpaceFerret opened this issue Dec 26, 2019 · 1 comment
Open

Help with the car example #110

SpaceFerret opened this issue Dec 26, 2019 · 1 comment

Comments

@SpaceFerret
Copy link

@SpaceFerret SpaceFerret commented Dec 26, 2019

Could someone help me write a couple lines of code so that when you press the left shift button it makes a really big speed boos so that I know how to set speeds? Thanks!

@shakiba
Copy link
Owner

@shakiba shakiba commented Dec 26, 2019

It is more ui and game logic question than physics engine.

  • You could change testbed to store e.shiftKey state in activeKeys, or do something similar in you own code.
  • To implement speed boost you need more than setting speed. One way to implement it is adding a boost variable and in each 'step' consume half (or any portion) of boost by reducing it from boost variable and adding it to normal car speed (setMotorSpeed), until boost is emptied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.