Class AIBrain.Patrol

java.lang.Object
com.codename1.gaming.platformer.AIBrain.Patrol
All Implemented Interfaces:
AIBrain.Action
Enclosing class:
AIBrain

public static final class AIBrain.Patrol extends Object implements AIBrain.Action
Walks back and forth, turning at walls and, if turnAtLedges, at drops.
  • Constructor Details

    • Patrol

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

      public Patrol(boolean turnAtLedges)

      A patrol.

      Parameters
      • turnAtLedges: whether to turn at a drop instead of walking off it
  • Method Details

    • act

      public int act(AIBrain brain, Actor self, PlatformWorld world)
      Description copied from interface: AIBrain.Action

      Computes this tick's buttons.

      Parameters
      • brain: the brain, for its timers and target
      • self: the actor
      • world: the world
      Returns

      Input bits

      Specified by:
      act in interface AIBrain.Action