Sorry my code wasn't of any help. Basically there are lots of ways to make a platformer and most have some complexity in there somewhere. In some ways you are better off figuring this issue out yourself for the experience points. Good luck!
You must have me confused with the amazing Amon. :)