Are you making a platformer?
Mystified how to write basic physics for it?
Why not learn from one of the best platformers of all time, Super Mario Bros 3!
I converted the SMB3 source code related to player movement into more readable JavaScript.
Check out the demo here:
And read the JavaScript source: