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.TargetWithin
- Object
- AIBrain.TargetWithin
ImplementsAIBrain.Decision
Holds when the player is within a distance, and optionally in front.
Constructors
public TargetWithin(int range, boolean inFront) | A range check. |
Methods
public boolean decide(AIBrain brain, Actor self, PlatformWorld world) | Whether the transition should fire. |
Inherited methods
Constructor details
TargetWithin
public TargetWithin(int range, boolean inFront)A range check.
Parameters
rangeint- the distance, fixed point, measured on each axis
inFrontboolean- whether the player must also be on the facing side
Method details
decide
public boolean decide(AIBrain brain, Actor self, PlatformWorld world)Whether the transition should fire.
Parameters
brainAIBrain- the brain
selfActor- the actor
worldPlatformWorld- the world
Returns
true to switch