Here is a standalone version of the player code that is being used in my Evoeon 2D game builder. I am sure there are easier and cleaner ways to code this, but here is the original code. Use it for whatever you want.

Includes 2 free sprite characters and a help file for editing the code.
2D Player Code