I'm having collision detection trouble. Here's my code:
hide mouse
load bitmap "logosplash.bmp"
center text 300,300,"Press Any Key. Press ESC at any time to quit. DirectX 7.0 Required."
suspend for key
rem Load sounds
load 3Dsound "aircraft.wav",1
rem Setup
autocam off
rem Load Biplane
load object "Red Biplane.x",2
scale object 2,20,20,20
rem Load world
load object "castle1.x",1
scale object 1,2000,2000,2000
rotate object 1,0,0,0
position object 1,50,-100,50
rem Make wire sky sphere
make object sphere 3,10
remstart
rem Performs a checklist for all contol devices
perform checklist for control devices
rem Check for FF flag
ffok=0
for t=1 to checklist quantity()
if checklist value a(t)=1 then ffok=t
next t
set control device checklist string$(ffok)
remend
rem Set variables for character position
x#=500
z#=500
rem Wind and gravity
yspeed# = 0.0
xspeed# = 0.0
acc# = 0.1
gravity# = .5
wind# = 0
rem Activate manual sync
sync on
rem Set camera range
set camera range 2,1000000
rem Sound setup
loop sound 1
position listener object position x(2),object position y(2),object position z(2)
rem Begin loop
do
REM Add forces
xspeed# = zspeed# + gravity#
zspeed# = xspeed# + wind#
rem Control free flight object
if downkey()=1 then pitch object up 2,3 - gravity# + acc#
if upkey()=1 then pitch object down 2,3 + gravity# + acc#
if leftkey()=1 then roll object left 2,3 + wind#
if rightkey()=1 then roll object right 2,3 - wind#
if mouseclick()=0 then move object 2,2.5 + acc#
if spacekey()=1 then position object 2,0,10,0
rem Control free flight object
if joystick down()=1 then pitch object up 2,3 - gravity# + acc#
if joystick up()=1 then pitch object down 2,3 + gravity# + acc#
if joystick left()=1 then roll object left 2,3 + wind#
if joystick right()=1 then roll object right 2,3 - wind#
rem Set collision on
set global collision on
rem Get back position of object for camera
pitch object down 2,11
move object 2,-150
rem point camera 0,object position y(2),0
move object 2,150
pitch object up 2,11
xpos# = xpos# + xspeed#
ypos# = ypos# + yspeed#
rem Point camera at plane
rem point camera 0,Y#,Z#
point camera object position x(2),object position y(2),object position z(2)
rem Misculanious things
hide object 3
rem Update Screen
sync
loop
if you can tell me where to put the collision code and what the code is it would help tons.
Thanks