look at this code, it works fine:
sync on
sync rate 450
hide mouse
load image "media/grass.bmp",1
load image "media/ball.png",2
dim active(100,2)
maxwait=150
load dll "DBCollisions.dll",1
for b=1 to 100
make object sphere b,5
texture object b,2
hide object b
next b
color backdrop rgb(0,0,255)
rem make level
make matrix 1,1000.0,1000.0,60,60
prepare matrix texture 1,1,1,1
set matrix texture 1,0,1
randomize matrix 1,0.1
load object "media/test.x",101
position object 101,150,Y#+10,150
scale object 101,10,10,10
make object plain 102,1000,100
position object 102,500,48,0
make object plain 103,1000,100
position object 103,500,48,1000
make object plain 104,1000,100
Yrotate object 104,90
position object 104,998,48,500
make object plain 105,1000,100
Yrotate object 105,90
position object 105,2,48,500
load object "media/three.x",106
position object 106,200,Get Ground Height(1,X#,Z#),50
scale object 106,10,10,10
load object "media/three.x",107
position object 107,500,Get Ground Height(1,X#,Z#),900
scale object 107,10,10,10
load object "media/three.x",108
position object 108,400,Get Ground Height(1,X#,Z#),700
scale object 108,10,10,10
load object "media/three.x",109
position object 109,200,Get Ground Height(1,X#,Z#),600
scale object 109,10,10,10
load object "media/three.x",110
position object 110,900,Get Ground Height(1,X#,Z#),300
scale object 110,10,10,10
load object "media/three.x",111
position object 111,400,Get Ground Height(1,X#,Z#),500
scale object 111,10,10,10
fog on
fog color rgb(1,100,50)
fog distance 1000
set mipmap mode 2
gravity#=100
do
Y# = Get Ground Height(1,X#,Z#)
X# = Object position X(101)
Z# = Object position Z(101)
aY# = Object angle Y(101)
cZ# = Newzvalue(Z#,aY#,50)
cX# = Newxvalue(X#,aY#,50)
cY# = Get Ground Height(1,X#,Z#)+50
if upkey()=1 then move object 101,-0.5
if downkey()=1 then move object 101,0.5
if leftkey()=1 then Yrotate object 101,wrapvalue(aY#-0.5)
if rightkey()=1 then Yrotate object 101,wrapvalue(aY#+0.5)
position camera cX#,30,cZ#
point camera X#,5,Z#
gosub shoot
sync
loop
shoot:
for b=1 to 100
if spacekey()=1 and active(b,1)=0 and (timer()-lasttime)>maxwait
position object b,X#,Y#,Z#
set object to object orientation b,101
active(b,1)=1
active(b,2)=200
show object b
lasttime=timer()
endif
if active(b,1)=1
move object b,-2
active(b,2)=active(b,2)-1
endif
if active(b,2)<0
active(b,1)=0
active(b,2)=0
hide object b
endif
next b
return
delete dll 1
but when i start to make collisions, doesn't read the compiler the position of the player-object(test.x):
sync on
sync rate 450
hide mouse
load image "media/grass.bmp",1
load image "media/ball.png",2
dim active(100,2)
maxwait=150
load dll "DBCollisions.dll",1
for b=1 to 100
make object sphere b,5
texture object b,2
hide object b
next b
color backdrop rgb(0,0,255)
rem make level
make matrix 1,1000.0,1000.0,60,60
prepare matrix texture 1,1,1,1
set matrix texture 1,0,1
randomize matrix 1,0.1
load object "media/test.x",101
position object 101,150,Y#+10,150
scale object 101,10,10,10
make object plain 102,1000,100
position object 102,500,48,0
make object plain 103,1000,100
position object 103,500,48,1000
make object plain 104,1000,100
Yrotate object 104,90
position object 104,998,48,500
make object plain 105,1000,100
Yrotate object 105,90
position object 105,2,48,500
load object "media/three.x",106
position object 106,200,Get Ground Height(1,X#,Z#),50
scale object 106,10,10,10
load object "media/three.x",107
position object 107,500,Get Ground Height(1,X#,Z#),900
scale object 107,10,10,10
load object "media/three.x",108
position object 108,400,Get Ground Height(1,X#,Z#),700
scale object 108,10,10,10
load object "media/three.x",109
position object 109,200,Get Ground Height(1,X#,Z#),600
scale object 109,10,10,10
load object "media/three.x",110
position object 110,900,Get Ground Height(1,X#,Z#),300
scale object 110,10,10,10
load object "media/three.x",111
position object 111,400,Get Ground Height(1,X#,Z#),500
scale object 111,10,10,10
fog on
fog color rgb(1,100,50)
fog distance 1000
set mipmap mode 2
gravity#=100
do
If Object collision(101,102)=1 then position object 101,X#,Y#+10,Z#
Y# = Get Ground Height(1,X#,Z#)
X# = Object position X(101)
Z# = Object position Z(101)
aY# = Object angle Y(101)
cZ# = Newzvalue(Z#,aY#,50)
cX# = Newxvalue(X#,aY#,50)
cY# = Get Ground Height(1,X#,Z#)+50
if upkey()=1 then move object 101,-0.5
if downkey()=1 then move object 101,0.5
if leftkey()=1 then Yrotate object 101,wrapvalue(aY#-0.5)
if rightkey()=1 then Yrotate object 101,wrapvalue(aY#+0.5)
position camera cX#,30,cZ#
point camera X#,5,Z#
gosub shoot
sync
loop
shoot:
for b=1 to 100
if spacekey()=1 and active(b,1)=0 and (timer()-lasttime)>maxwait
position object b,X#,Y#,Z#
set object to object orientation b,101
active(b,1)=1
active(b,2)=200
show object b
lasttime=timer()
endif
if active(b,1)=1
move object b,-2
active(b,2)=active(b,2)-1
endif
if active(b,2)<0
active(b,1)=0
active(b,2)=0
hide object b
endif
next b
return
delete dll 1
can anyone help me!?