Ok, here's the code ToXic sent me.
Set Display Mode 800,600,16
Sync On
Sync Rate 0
Hide Mouse
AutoCam Off
Color Backdrop 0
`Play here.
`------------------------
EnemyCount=11
Dim EnemySpeed#(EnemyCount)
For T=1 to EnemyCount
EnemySpeed#(T)=Rnd(6)+4
Next T
RadarRange=20000
ShipSpeedMax#=6.0
`------------------------
`Make ship object.
Make Object Sphere 1000,25
Position Object 1000,2500,0,2500
`Make test objects.
For T=1 to EnemyCount
Make Object Cube T,50
Position Object T,RND(5000),0,RND(5000)
YRotate Object T,RND(360)
Next T
`Camera start position and range.
Position Camera 2500,0,2500
Set Camera Range 1,RadarRange-1000
`Make and position matrix.
Make Matrix 1,25000,25000,10,10
Position Matrix 1,-12500,-300,-12500
`Main Loop--------------
Do
Line 400,290,400,310
Line 390,300,410,300
`Control ship.
CaX#=WrapValue(CaX#+MouseMoveY()/2)
If Inverted=1
CaY#=WrapValue(CaY#-MouseMoveX()/2)
Else
CaY#=WrapValue(CaY#+MouseMoveX()/2)
EndIf
Rotate Object 1000,CaX#,CaY#,CaZ#
`Control ship speed.
If Delay>0 Then Dec Delay
If MouseClick()=1 and Delay=0 Then Delay=20:Inc ShipSpeed#,1.0
If MouseClick()=2 and Delay=0 Then Delay=20:Dec ShipSpeed#,1.0
If ShipSpeed#>ShipSpeedMax# Then ShipSpeed#=ShipSpeedMax#
If ShipSpeed#=<0 Then ShipSpeed#=1.0
`Move ship.
Move Object 1000,ShipSpeed#
`Camera settings.
Position Camera Object Position X(1000),Object Position Y(1000),Object Position Z(1000)
Set Camera to Object Orientation 1000
Move Camera ShipSpeed#+1.0
`Keep the objects in an area.
For T=1 to EnemyCount
SETOBJECTAREA(T,2500.0,2500.0,10000.0)
Next T
`Check radar.
Inverted=RADAR(1000,RadarRange,1,EnemyCount)
Center Text 400,10,"Mouse to move around, mouse buttons for speed... "
If ShipSpeed#=>ShipSpeedMax#
Center Text 400,25,"Ship speed : Max"
Else
Center Text 400,25,"Ship speed :"+Str$(ShipSpeed#)
EndIf
Center Text 400,40,"FPS : "+Str$(Screen FPS())
Sync
Loop
`End Loop---------------
Function RADAR(Ship,RadarRange,ObjFrom,ObjTo)
`Ship = The object you are controling.
`RadarRange = Radar range.
`ObjFrom = The first object to check for.
`ObjTo = The last object to check for.
`Draw radar.
Ink RGB(255,255,255),0
ELLIPSE 93,504,88,88
Dot 93,504
`Radar range.
G#=RadarRange/84
For T=ObjFrom to ObjTo
If Object Exist(T)
ObjX1#=Object Position X(Ship)
ObjY1#=Object Position Y(Ship)
ObjZ1#=Object Position Z(Ship)
ObjX2#=Object Position X(T)
ObjY2#=Object Position Y(T)
ObjZ2#=Object Position Z(T)
Dx#=ABS(ObjX1#-ObjX2#)
Dy#=ABS(ObjY1#-ObjY2#)
Dz#=ABS(ObjZ1#-ObjZ2#)
Dist#=SQRT((Dx#*Dx#)+(Dy#*Dy#)+(Dz#*Dz#))
`Convert 3d position to 2d position for radar blip.
XRadar=(Object Position X(T)-Object position X(Ship))/G#
ZRadar=(Object Position Z(T)-Object position Z(Ship))/G#
`Angle for radar blip.
TanAngle=ATANFULL(XRadar,ZRadar)
If Object Angle X(Ship)>90 and Object Angle X(Ship)<270
`If the unit is up side down (Reverse the angle).
Heading=TanAngle-Object Angle Y(Ship)-180
Inverted=1
Else
Heading=TanAngle-Object Angle Y(Ship)
Inverted=0
EndIf
`Plot the distance and angle for radar blip.
NewXRadar=(SIN(Heading)*Dist#)/G#
NewZRadar=(COS(Heading)*Dist#)/G#
`Display any enemy objects in radar range.
If Dist#<=RadarRange
Ink RGB(255,0,0),0
If Inverted=0
Dot 93+NewXRadar,504-NewZRadar:Inverted=0
Else
`If Inverteded reverse radar.
OK=0
If NewXRadar>93 Then X=NewXRadar-93:NewXRadar=X:OK=1
If NewXRadar<93 and OK=0 Then X=93-NewXRadar:NewXRadar=X:OK=1
If NewXRadar=93 and OK=0 Then X=93
Dot X,504-NewZRadar
EndIf
EndIf
EndIf
Next T
EndFunction Inverted
Function SETOBJECTAREA(Obj,XPos#,ZPos#,Radius#)
X#=Object Position X(Obj)
Z#=Object Position Z(Obj)
A#=Object Angle Y(Obj)
Dist#=SQRT((X#-XPos#)^2.0+(Z#-ZPos#)^2.0)
If Dist#>Radius#
Point Object Obj,XPos#,Object Position Y(Obj),ZPos#
A#=WrapValue(A#-(EnemySpeed#(Obj)/4))
EndIf
YRotate Object Obj,A#
Move Object Obj,EnemySpeed#(Obj)
EndFunction