Hope this helps. I recommend searching up tutorials--getting several different opinions on how to code a platformer will help, and you understand your code better than I do meaning you'll be better at debugging than me.
I added comments on the inside specifying which things I did. Everything else is by @leothegreat101. Leo and anyone else can use my art and code, ask Leo if you want to use theirs.