Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public static final class AIBrain.Patrol

  1. Object
  2. AIBrain.Patrol

ImplementsAIBrain.Action

Walks back and forth, turning at walls and, if turnAtLedges, at drops.

Constructors

public Patrol()A patrol that turns at walls and ledges.
public Patrol(boolean turnAtLedges)A patrol.

Methods

public int act(AIBrain brain, Actor self, PlatformWorld world)Computes this tick’s buttons.

Inherited methods

Constructor details

Patrol

public Patrol()
A patrol that turns at walls and ledges.

Patrol

public Patrol(boolean turnAtLedges)
A patrol.

Parameters

turnAtLedges boolean
whether to turn at a drop instead of walking off it

Method details

act

public int act(AIBrain brain, Actor self, PlatformWorld world)
Computes this tick’s buttons.

Parameters

brain AIBrain
the brain, for its timers and target
self Actor
the actor
world PlatformWorld
the world

Returns

Input bits