Please... Don't use that method for jumping... It makes the player go up in a linear path and then down in a linear path, and that looks horrible.
What you need is gravity based jumping. Here's an example (I haven't compiled it, so I don't know if it runs or not):
rem setup screen
sync on
sync rate 60
backdrop on
color backdrop 0
hide mouse
rem global variables
global x# as float
global y# as float
global z# as float
global grav# as float
global grav_strength# as float
rem set strength of gravity (play around with this to make it look right)
grav_strength#=0.1
rem set start positions of player
x#=0
y#=10
z#=0
rem make a player
make object cylinder 1,10
color object 1,rgb(0,0,255)
make object collision box 1,-5,-5,-5,5,5,5,0
rem make a ground object
make object box 2,100,5,100
color object 1,rgb(120,40,20)
make object collision box 2,-50,-2.5,-50,50,2.5,50,0
rem main loop
do
rem user info
center text 320,20,"press space to jump"
rem input
if spacekey()=1 and grav#=0.0 then grav#=2.0
rem control gravity
dec grav#,grav_strength#
inc y#,grav#
rem update positions of player for collision check
position object 1,x#,y#,z#
rem check for collision with other objects
if object collision(1,0)
dec x#,get static collision x()
dec y#,get static collision y()
dec z#,get static collision z()
grav#=0.0
endif
rem update player positions
position object 1,x#,y#,z#
rem control camera
position camera 0,20,-50
point camera x#,y#,z#
rem refresh screen
sync
rem end of main loop
loop
rem end
end
TheComet