WARNING: This is a bit glitchy, so use at your own risk. Use A and D or the right and left arrow keys to move. Use space to change gravity. Use W or the up arrow key to jump.
You can remix/backpack this and use it for whatever you want, just make sure to give me credit (and, if possible, send me a link to your game :D). Inspired by Gravity by @JamesOuO. Original (and heavily simplified) code by @ADancingCockatoo.