Platform games are fairly difficult, so don't worry if it seems harder than expected. Attached is a screen shot with the code for my samples folder. There is a lot of good stuff in there, but you will want to open the file "PLATFORM". That has a very basic mario style game loop. No enemies slopes, or moving platforms, and sometimes you can get jump stuck in a wall. But, I think it should help.