Greetings!
I have a problem with steering my ship by computer. Here is the source for an example I quickly made:
rem A.I problem
rem collecting example
rem by the comet
rem setup screen
sync on
sync rate 30
backdrop on
color backdrop 0
hide mouse
rem make 30 plain objects
for t=1 to 30
make object plain t,2,2
position object t,rnd(20)-10,rnd(20)-10,-10-rnd(150)
make object collision box t,-1,-1,-1,1,1,1,0
next t
rem make a ship
make object sphere 31,2
position object 31,0,0,0
rotate object 31,0,180,0
color object 31,rgb(255,0,0)
make object collision box t,-1,-1,-1,1,1,1,0
rem main loop
z#=0
do
rem move ship
dec z#,0.4
rem position ship
position object 31,x4#,y4#,z#
rem position and point camera
position camera -5,2,z#-20
rem refresh screen
sync
rem end of main loop
loop
I want the red sphere to collect the plain objects. But it should only collect the ones nearest to it. The variables x4# and y4# should be incremented and decremented by 0.3.
Thanks, TheComet
Oooooops!!! I accidentally formated drive c.