ok anyway, I was looking around for some useful code and I cam across two code snippets, one is for a flight sim, and the other is for a bullet shooting code.I decided I would try my best to combine them and create a game, so I combined them and got the following code
`_______________________________________________________________________________
`..................<<<<<<<............................/__..............
`................<<<<<<<<<<<<......................../___..............
`..............<<<<<<<<<<<<<<<<_____________________/____..............
`...........---____________________________________/_____..............
`......------------- ____________________--USA____________}';';';......
`...(------------- (____________________)________________}';';';......
`.....____________________________________________________};';';';.....
`......................................................................
set display mode 640, 480, 32
hide mouse
disable escapekey
speed#=12
thrust#=12
autocam off
`matrix
make matrix 1,10000,10000,50,50
randomize matrix 1, 50
` plane
load object "airpl008.x",111
load bitmap "F15.bmp",1
get image 1,0,0,256,256
texture object 111,1
rotate object 111,0,270,0
fix object pivot 111
scale object 111,400,400,400
position object 111,50,50,50
`dims
dim active(100,2)
maxwait=150
`make bullets
for b=1 to 100
make object sphere b,1
color object b,rgb(255,0,0)
hide object b
next b
` drone for camera
make object sphere 1000,10
` camera range
set camera range 1,10000
sync on
do
sync
gosub shoot
if keystate(30)=1 then roll object left 111, 1
if keystate(32)=1 then roll object right 111, 1
if keystate(31)=1 then pitch object up 111, 1
if keystate(17)=1 then pitch object down 111, 1
if keystate(42)=1 then thrust#=thrust#+.25
if thrust#>50 then thrust#=50
if keystate(58)=1 then thrust#=thrust#-.5
if thrust#<0 then thrust#=0
speed#=curvevalue(thrust#,speed#,25)
move object 111, speed#
print speed#
set cursor 120,1
altitude#=object position y(111)
print altitude#
if speed#<12 then position object 111, object position x(111), object position y(111)-(15-speed#), object position z(111)
if speed#<7 then position object 111, object position x(111), object position y(111)-(9-speed#),object position z(111):set cursor 1,1:print "STALL!"
set cursor 50,1
` camera controls
` get drone pos.
pitch object down 111,11
move object 111,-150
position object 1000, object position x(111),object position y(111),object position z(111)
move object 111,150
pitch object up 111,11
` move camera
position camera object position x(1000),object position y(1000), object position z(1000)
set camera to object orientation 111
loop
shoot:
`for
for b=1 to 100
`shoot
if spacekey()=1 and active(b,1)=0 and (timer()-lasttime)>maxwait
position object b, object position x(111), object position y(111), object position z(111)
set object to object orientation b,111
active(b,1)=1
active(b,2)=200
show object b
lasttime=timer()
endif
`move bullet
if active(b,1)=1
move object b,.1
active(b,2)=active(b,2)-1
endif
`stop when bullet run out
if active(b,2)<0
active(b,1)=0
active(b,2)=0
hide object b
endif
next b
return
The problem is that when ever I run it (DBC) the camera just sits there and nothing happens, I cant even see my plane! This is weird because everything works when I leave them seperate but if I combine them it screws everything up. Please look over the code and see what is wrong because I cant figure it out.
Thanks
P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.