Quote: "I have never physically tried but I can never work out how to make a thing jump when it goes off a ramp, but still adjust to the land when it is ont the ground."
Ah, that is easy.
You will have some variable called "grav#" or "playergrav#" or "gravity#". Find that, and set it to the difference of y# and oldy# of the player positions if it is currently on the ground. I wrote a quick example for you to work on if you are interested:
rem jump example
rem by TheComet
rem setup screen
set display mode 1024,768,32
sync on
sync rate 60
backdrop on
color backdrop rgb(128,128,128)
autocam off
set camera range 1,3000
fog on
fog distance 3000
fog color rgb(128,128,128)
hide mouse
rem create a floor texture
create bitmap 1,30,10
set current bitmap 1
ink rgb(90,90,90),0
box 0,0,29,9
ink rgb(110,110,110),0
box 1,1,28,8
ink rgb(130,130,130),0
box 2,2,27,7
for t=1 to 2000
r=rnd(40)+90
ink rgb(r,r,r),0
circle rnd(22)+3,rnd(22)+3,2
next t
blur bitmap 1,5
get image 1,0,0,30,10
delete bitmap 1
create bitmap 1,128,128
for x=0 to 120 step 30
for y=0 to 120 step 10
paste image 1,x,y
next y
next x
delete image 1
get image 1,0,0,128,128
delete bitmap 1
rem create a wooden ball texture
create bitmap 1,64,64
set current bitmap 1
ink rgb(128,64,0),0
box 0,0,63,63
for t=1 to 2000
r=rnd(80)+40
ink rgb(r,r/2,0),0
x1=rnd(63)
y1=rnd(63)
if rnd(1)=0
x2=x1+rnd(32)-16
y2=y1
else
x2=x1
y2=y1+rnd(32)-16
endif
next t
blur bitmap 1,4
get image 2,0,0,64,64
delete bitmap 1
rem make a matrix
make matrix 1,10000,10000,20,20
prepare matrix texture 1,1,2,2
fill matrix 1,0,1
randomize matrix 1,300
rem make a player
make object box 1,10,10,50
texture object 1,2
position object 1,5000,400,5000
rem main loop
do
rem control camera
set camera to follow x#,y#,z#,camera angle y(),100,y#+50,10,0
point camera x#,y#,z#
rem get old y position for jump physics
oldy#=y#
rem get positions of player
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
rem get input from user
if landed=1
if upkey()=1 then sp#=curvevalue(10,sp#,100)
if downkey()=1 then sp#=curvevalue(-2,sp#,50)
if leftkey()=1 then ay#=wrapvalue(ay#-2)
if rightkey()=1 then ay#=wrapvalue(ay#+2)
endif
rem move player
x#=newxvalue(x#,day#,sp#)
z#=newzvalue(z#,day#,sp#)
rem if up or down is not pressed, slow down to 0
if upkey()=0 and downkey()=0 and landed=1 then sp#=curvevalue(0,sp#,50)
rem if left or right is not pressed, set the angle to the avarage of day# and ay# for extra turn physics
if leftkey()=0 and rightkey()=0 and landed=1 then day#=curveangle(ay#,day#,30)
rem calculations with angle
day#=curveangle(ay#,day#,30)
rem gravity
if grav#<-0.5 or grav#>0.5 then landed=0
dec grav#,0.1
inc y#,grav#
g#=get ground height(1,x#,z#)
if y#<g# then y#=g#:grav#=0.0:landed=1:if y#-oldy#>0:grav#=y#-oldy#:endif
rem update player positions and rotations
position object 1,x#,y#,z#
yrotate object 1,ay#
rem boundaries
if x#>10000 or x#<0 or z#>10000 or z#<0 then position object 1,5000,400,5000:grav#=0.0
rem refresh screen
sync
rem end of main loop
loop
TheComet
Peachy, and the Chaos of the Gems
