I reworked most of the code to make the horizontal movement smoother and the jump more "realistic". It definitely needs some work, especially with a bug I encountered, but this should be decent enough for your use.