can anyway help me, i need to know how to do collisions in a fps game heres my code, please can someone help, i wanna make it collide with object 3, object 10 is the player..help!!
REM SET UP SYNC
sync on
sync rate 30
hide mouse
REM LOAD IMAGES
load image "creep02.bmp",1
REM CREATE MATRIX
make matrix 1,2000,2000,50,50
prepare matrix texture 1,1,2,2
randomize matrix 1,10
REM PLACE THE TEXTURE TILES ONTO THE MATRIX
for x = 0 to 19
for z = 0 to 19
t = rnd(3) +1
set matrix tile 1,x,z,t
next z
next x
REM UPDATE CHANGES TO THE MATRIX
update matrix 1
REM LOAD COL OBJECT
make object sphere 10,10
set object collision to spheres 10
set object collision on 10
position object 10,CamX#,CamY#,CamZ#
lock object on 10
make object cube 3,200
position object 3,500,0,500
set object collision to boxes 3
set object collision on 3
REM MAIN LOOP////////////////////////////////////////////////////////
Do
CamX# = Camera position X()
CamZ# = Camera position Z()
CamY# = Camera position Y()
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)
REM CONTROL INPUT FOR CAMERA
If Upkey()=1
XTest# = Newxvalue(X#,CameraAngleY#,10)
ZTest# = Newzvalue(Z#,CameraAngleY#,10)
If XTest#>0 and XTest#0 and ZTest#0 and XTest#0 and ZTest#0 and XTest#0 and ZTest#0 and XTest#0 and ZTest#0
X# = CamX#
Y# = CamY#
Z# = CamZ#
endif
Y# = Get ground height(1,X#,Z#)
Position Camera X#,Y#+50,Z#
REM REFRESH AND END OF MAIN LOOP
Sync
Loop