For gravity, what I do is make a float (maybe yspeed#), I set the value of yspeed# to something in the negative, then when you press the jump key, it sets the value to something positive, but gradually decreases into a negative number again. Also you'd move the object you wanted to jump up by yspeed#. Like this:
hide mouse
box 0,0,10,10
get image 1,0,0,10,10
`The value I talked about.
yspeed#=-0.00002
stop=0
`The coordinates for the sprite.
x#=0
y#=0
do
sprite 1,x#,y#,1
`Sort of collision with the bottom of the screen.
if y#=>screen height()-10 and yspeed#=<0 then y#=y#+yspeed#
`The side to side movement of the sprite.
if leftkey()=1 then x#=x#-0.1
if rightkey()=1 then x#=x#+0.1
`The gravity part.
if upkey()=1 and stop=0 then yspeed#=0.04 : stop=1
if upkey()=0 then yspeed#=yspeed#-0.00001 : stop=0
y#=y#-yspeed#
loop
Hope it helps.
Try.