The scanner provides information about the bot's environment. Using the scanner a bot can see
and identify the objects that are in the scanner's field of view (45 degrees) and range (20 meters),
except of course those that are obstructed by (e.g. hidden behind) other objects.
The scanner's range is reduced if it's damaged.
Use the Scanner property of your AI class to access the scanner.
Example
The following code scans for objects and fires at those that are in weapon range.
List<ScannedObject> foundObjects = Scanner.Scan();
foreach (ScannedObject foundObject in foundObjects)
{
if (Weapons.Pulsar.IsInRange(foundObject.Position))
{
Weapons.Pulsar.Fire(foundObject.Position);
}
}
Recommended Topics