com.brackeen.javagamebook.ai.pattern
Class AimPattern
java.lang.Object
com.brackeen.javagamebook.ai.pattern.AIPattern
com.brackeen.javagamebook.ai.pattern.AimPattern
- All Implemented Interfaces:
- PathFinder
- public class AimPattern
- extends AIPattern
Direct aim at the player, with a random offset. Aim patterns
return a direction to fire, rather than a location.
Method Summary |
java.util.Iterator |
find(GameObject bot,
GameObject player)
Finds a path from GameObject A to GameObject B. |
void |
setAccuracy(float p)
Sets the accuracy of the aim from 0 (worst) to 1 (best). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AimPattern
public AimPattern(BSPTree tree)
setAccuracy
public void setAccuracy(float p)
- Sets the accuracy of the aim from 0 (worst) to 1 (best).
find
public java.util.Iterator find(GameObject bot,
GameObject player)
- Description copied from interface:
PathFinder
- Finds a path from GameObject A to GameObject B. The path
is an Iterator of Vector3Ds, not including the start
location (GameObject A) but including the goal location
(GameObject B). The Vector3D objects may be used in
other objects and should not be modified.
Returns null if no path found.
- Specified by:
find
in interface PathFinder
- Specified by:
find
in class AIPattern