BAIT 2005

Miscellaneous Forums/Blitz Showcase/BAIT 2005

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

How bout a scanner where you set the degree range to scan, it takes a number divided by this to find the distance.

for instance, 360:

20 degrees - 360/20 = 18 meters
30 degrees - 360/30 = 12 meters
45 degrees - 360/45 = 8 meters
90 degrees - 360/90 = 4 meters
180 degrees- 360/180= 2 meters
360 degrees- 360/360= 1 meter

Perhaps a bit higher bias could be set depending on how big the scenarios are. Here's my idea for an example botai:

Global ScanAng#

Function Init(out.output)
 out.ScanRange=20
End Function

Function Main(in.status, out.output)
 If in\ScannedEnemy Then
  If in.ScanAngle>3 Then
   out.LeftMotor=100
   out.RightMotor=100-Abs(in.ScanAngle)
  Elseif in.ScanAngle<3
   out.RightMotor=100
   out.LeftMotor=100-Abs(in.ScanAngle)
  Else
   out.Shoot=1
  EndIf
 Else
  ScanAng#=ScanAng#+20
 EndIf
 out.ScanAng#=ScanAng#-in.BotAng
End Function