Okay, on the jumping code....
the trouble is, from what I have seen in my own code as well as that of others, is that jumping is "too strongly based" in the upkey() detection. What I mean is, we often detect the upkey() without regard to whether ot not the character is already jumping, so the detection should be;
if upkey()=1 and jumping=0 then jumping=1 : <jump up code>
and the reverse is also true, if your character is falling.
if jump=1 and object position y() = maxlimit then jump = 2 : <falling code>
and then, when the objcet hits the ground;
if jump=2 and object position y()= ground height then jump = 0
to reset it all for another jump in the upkey is still held.
That's my two cents to this topic.. hope it helps.
S.
Any truly great code should be indisguishable from magic.