i am having twouble with colliding with my walls. i put in multiple codes for collision and i cannot seem to get it right. any help will be appreciated.
SYNC ON : hide mouse
sync rate 30
make matrix 1, 200.0, 200.0, 20, 20
position matrix 1, 0, 0, 0
make object box 3, 200, 30, 5 : color object 3, rgb(0, 0, 0)
position object 3, 100, 15, 0
make object box 4, 200, 30, 5 : color object 4, rgb(0, 0, 0)
position object 4, 100, 15, 200
make object box 5, 200, 30, 5 : color object 5, rgb(90, 100, 67)
position object 5, 200, 15, 100 : yrotate object 5, 90
make object box 6, 90, 30, 5 : color object 6, rgb(90, 110, 56)
position object 6, 0, 15, 45 : yrotate object 6, 90
camobj=7
make object sphere camobj, 2
hide object camobj
position camera 10, 10, 10
point camera 150, 10, 5
set camera range 1,2000
DO
oldx#=camera position x()
oldz#=camera position z()
set cursor 5,5
print screen fps()
IF LEFTKEY()=1 THEN angle#=angle#-3.0
IF RIGHTKEY()=1 THEN angle#=angle#+3.0
angle#=wrapvalue(angle#)
YROTATE CAMERA angle#
IF UPKEY()=1 THEN MOVE CAMERA 10
IF DOWNKEY()=1 THEN MOVE CAMERA -10
x#=camera position x()
z#=camera position z()
y#=get ground height(1,x#,z#)+10
position camera x#,y#,z#
position object camobj, x#, y#, z#
if object collision(camobj,3)
position camera oldx#,y#,oldz#
endif
if object collision(camobj,4)
position camera oldx#,y#,oldz#
endif
if object collision(camobj,5)
position camera oldx#,y#,oldz#
endif
SYNC
LOOP