could we see some code ianm i think i've got it working but the collision code is wrong and i think its quite a long way of doing it, anyways, one side of the matrix has been coded to have collision(the left side from your starting position) walk towards it and one tile before the edge you will stop... and then won't be able to move anymore
sync on
sync rate 0
rem make a matrix
make matrix 1,500,500,10,10
hide mouse
rem populating the array
dim colcoords(10,10)
colcoords(1,1)=1
colcoords(1,2)=1
colcoords(1,3)=1
colcoords(1,4)=1
colcoords(1,5)=1
colcoords(1,6)=1
colcoords(1,7)=1
colcoords(1,7)=1
colcoords(1,8)=1
colcoords(1,9)=1
colcoords(1,10)=1
rem amin loop
do
rem position and angle variables
oldx#=camera position x()
oldz#=camera position z()
oldy#=camera position y()
cAY# = WrapValue(cAY#+MousemoveX()*0.2)
cAX# = WrapValue(cAX#+MousemoveY()*0.2)
caZ# = Camera angle Z()
X#=camera position x()
Y#=camera position y()
Z#=camera position z()
rem converts world units into array coordinates, must be an easier way
if x#>=0 and x#<50 then colx=1
if x#>=50 and x#<100 then colx=2
if x#>=100 and x#<150 then colx=3
if x#>=150 and x#<200 then colx=4
if x#>=200 and x#<250 then colx=5
if x#>=250 and x#<300 then colx=6
if x#>=300 and x#<350 then colx=7
if x#>=350 and x#<400 then colx=8
if x#>=400 and x#<450 then colx=9
if x#>=450 and x#<500 then colx=10
if z#>=0 and z#<50 then colz=1
if z#>=50 and z#<100 then colz=2
if z#>=100 and z#<150 then colz=3
if z#>=150 and z#<200 then colz=4
if z#>=200 and z#<250 then colz=5
if z#>=250 and z#<300 then colz=6
if z#>=300 and z#<350 then colz=7
if z#>=350 and z#<400 then colz=8
if z#>=400 and z#<450 then colz=9
if z#>=450 and z#<500 then colz=10
rem movement code stolen from tutorial
set cursor 0,0
print screen fps()
oldcAY# = cAY#
oldcAX# = cAX#
cAY# = WrapValue(cAY#+MousemoveX()*0.2)
cAX# = WrapValue(cAX#+MousemoveY()*0.2)
caZ# = Camera angle Z()
Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,cAY#,5)
ZTest# = Newzvalue(Z#,cAY#,5)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Downkey()=1
XTest# = Newxvalue(X#,Wrapvalue(cAY#-180),5)
ZTest# = Newzvalue(Z#,Wrapvalue(cAY#-180),5)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Leftkey()=1
XTest# = Newxvalue(X#,Wrapvalue(cAY#-90),5)
ZTest# = Newzvalue(Z#,Wrapvalue(cAY#-90),5)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Rightkey()=1
XTest# = Newxvalue(X#,Wrapvalue(cAY#+90),10)
ZTest# = Newzvalue(Z#,Wrapvalue(cAY#+90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
Rem Rotate camera
cTestX#=WrapValue(cAX#-180)
if cTestX# > 225 then cAX#=45
if cTestX# < 135 then cAX#=315
YRotate camera CurveAngle(cAY#,oldcAY#,24)
XRotate camera CurveAngle(cAX#,oldcAX#,24)
Rem Position Camera
Y# = Get ground height(1,X#,Z#)+35
Position Camera X#,Y#,Z#
rem collision detection
if colcoords(colx,colz)=1
center text 320,240,"COLLISION!!!!!!!!!!!!!!!"
position camera oldx#,oldy#,oldz#
endif
sync
loop
someone fix it please this would help me loads
ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL
[email protected] to work on the new Star Strike project!!!