Posted: 12th Nov 2006 02:27
ok i've had db for about two weeks and im still new and i cant figure out how to make collision for all the objects, i\'ve been tryin some collision cammands but they haven\'t worked. so if anyone could explain this to me, that would be great
heer is what i have so far
sync on
sync rate 30
rem load images
load image \"metal_crackle.bmp\",1
load image \"GRASS09.BMP\",2
load image \"plate_rusted.bmp\",3
rem make and texture the inside matrix
make matrix 1,1000,1000,20,20
Prepare matrix texture 1,1,1,1
fill matrix 1,0,1
rem make and texture the outside matrix
make matrix 2,1000,1000,20,20
prepare matrix texture 2,2,1,1
fill matrix 2,0,1
POSITION MATRIX 2,1000,0,0
rem make windows
make object plain 4,50,50
position object 4,1000,200,250
rem Make three walls to create one with an opening for a door
rem make wall
make object box 1,500,500,0
position object 1,1000,200,250
yrotate object 1,90
texture object 1,3
Set object collision to boxes 1
rem make wall
make object box 3,110,360,0
position object 3,1000,270,550
yrotate object 3,90
texture object 3,3
Set object collision to boxes 3
rem make wall
make object box 2,400,500,0
position object 2,1000,200,800
yrotate object 2,90
texture object 2,3
Set object collision to boxes 2
rem load player
load object \"idle.x\",4
append object \"Walk.x\",4,21
loop object 4,0,20 : set object speed 4,10
set object collision to boxes 4
Rem Main loop
DO
set cursor 0,0
print X#
print Y#
print Z#
Rem Store Object angle
AngleY# = object angle Y(4)
Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,AngleY#,20)
ZTest# = Newzvalue(Z#,AngleY#,20)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
Move object 4,-10
Endif
Endif
If Downkey()=1
XTest# = Newxvalue(X#,AngleY#,20)
ZTest# = Newzvalue(Z#,AngleY#,20)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
Move object 4,10
Endif
Endif
If Leftkey()=1 then Yrotate object 4,Wrapvalue(AngleY#-5)
If Rightkey()=1 then Yrotate object 4,Wrapvalue(AngleY#+5)
X# = Object position x(4)
Z# = Object position z(4)
Y# = Get Ground Height(1,X#,Z#)
Position object 4,X#,Y#+0.0,Z#
CameraZ# = Newzvalue(Z#,AngleY#+360,100)
CameraX# = Newxvalue(X#,AngleY#+360,100)
CameraY# = Get Ground Height(1,CameraX#,CameraZ#)
Position camera CameraX#,CameraY#+50,CameraZ#
Point camera X#,Y#+25,Z#
Rem Refresh Screen
Sync
Loop