Info objects contained within your bot's hitlist will contain:
Info objects contained within your bot's collidelist will
contain:
public final double arctan(double x,
double y)
This method accepts a vector (x,y) and returns an angle from 0 - 2PI.
arctan() is a convenience method that calls the java.lang.Math.atan()
function and converts the -PI/2 - PI/2 output of atan() to 0 - 2PI using
the signs on the components of the vector.
public void ai()This is the brains of the bot. ai() should be over-ridden (redefined) to contain your own code.
protected final Vector Scan(double dir)Scanning takes a radian value specifying the direction in which a scan should be made. If values greater than 0 - 2PI are specified, they will be converted to equivalent forms within the above range. The sweep of the scan will be centered around this value. A Vector is returned containing all Info objects of all objects scanned in that region.
protected final Info getProjectileInfo(int id)This function returns a single Info object containing information for the specified projectile id. Projectile id's are returned by successful calls to Fire().
protected final boolean Cloak(boolean engagingcloaking)Cloak will enable or disable invisibility for a bot. Specify true to enable and false to disable. Cloak() will return true when the command is successful and false when it fails.
protected final boolean Drive(double dir)
protected final boolean Drive(double x,
double y)
protected final boolean Drive(double x,
double y,
double speed)
The first two Drive() methods take either a radian direction
or a (x,y) vector specifying the direction in which to move. These
methods will use a default speed of 5 units per turn. The third
Drive() method takes a (x,y) vector and then a speed which
is from 0-20 units per turn.
protected final int Fire(double direction)
protected final int Fire(double x,
double y)
Fire() accepts either a direction specified in radians or
a (x,y) vector. The method returns -1 when it fails and an integer
projectile ID which can be used with getProjectileInfo() to
obtain information on the projectile.
Back to the main JavaBots page.