Create a Flash game like Space is Key with a lot of room for customization

Did you ever play Space is Key by Christopher Jeffrey and its sequels?

It’s a quick one button game which can be used to learn some programming basics, so I am showing you this little prototype which allows a lot of customization such as player speed, jump height, jump rotation, number of floors and some minor features.

I am not using any physics engine because there’s no need in a game like this one, so let me show you the fully commented source code:

As you can see, I did not use any tween or special library, so the code can be easily ported in your preferred language.

And this is the result:

Try to jump with the mouse (yeah, no space here). No obstacles at the moment, I will introduce them in next step. If you are a fan of Space is Key series, you will notice I also fixed the jumping rotation when moving from right to left.

Edit: Got a mail from Chris, he told me « Also wanted to address the left/right jump that you ‘fixed’. It was actually designed and intended that way to do doing the ‘backflip’ instead of the ‘frontflip’ on some levels throws the player off and adds to the difficulty. »

Download the source code.