Ok I've got it where the sphere to jump up and down on the matrix, and on top of the cube or a flat object. Now the problem I'm trying solve is:
* Making the player stop when it hits the object sideways.
* The player should not touch the matrix real fast when it leaves the edge of the object. The fall rate should pull the object down before it hits the matrix.
I'm very close from making a 3rd person engine.
set window on
Randomize TIMER
cls rgb(0,128,0)
Line 0,0,32,32
Line 32,0,0,32
get image 1,0,0,32,32
`Load the matrix
make matrix 1,10000.0,10000.0,25,25
randomize timer()
For MOJO = 1 to 25
set matrix height 1,MOJO,1,200
set matrix height 1,MOJO,25,200
set matrix height 1,1,MOJO,200
set matrix height 1,25,MOJO,200
Next MOJO
For TOMTOM = 1 to 250
set matrix height 1,rnd(25),rnd(25),200
Next TOMTOM
make object sphere 1,10
make object box 2,100,100,100
prepare matrix texture 1,1,2,2
sync on
guyx#=1000
guyz#=1000
position object 1,object position x(1),guyy#,object position z(1)
JH#=0
do
`Text 1,1,STR$()
guyx#=object position x(1)
guyz#=object position z(1)
if (JumpAct=0 and FallAct=0) and object collision(1,0)=0 then guyy#=get ground height(1,guyx#,guyz#)
position object 1,guyx#,guyy#,guyz#
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y(1)-4)
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+4)
if upkey()=1 then move object 1,2
if downkey()=1 then move object 1,-2
if spacekey()=1 and JumpAct=0 Then JumpAct=1:Fall#=3
GGR#=get ground height(1,guyx#,guyz#)
IF guyy#0
JumpAct=0
Fall#=0
FallAct=0
Goto WOP:
ENDIF
ENDIF
WOP:
set camera to follow guyx#,guyy#,guyz#,object angle y(1),25.0,guyy#+10,3.5,1
sync
loop