Use the Arrow Keys to move; don't hit the spike.
This is a school project, BTW, and it took me like 40 minutes to code because coding the gravity takes a bit of time. This is for people who want to make a platformer, not a game.