wow!! awesome, easy to read and very complete tutorial! though movement scripting isn't really my forte, this tutorial will be very useful for learning about how it all works.

I'd make a little recommendation to make it more readable, though-- switch magic numbers with some more readable defines.. like jumping_mode = 0 or 1 or 2, could be replaced with

define not_jumping, 0
define jump_upwards, 1
define jump_coming_down, 2

so jumping_mode = not_jumping etc!

magic numbers always make me confused