Class AIBrain.TargetWithin
java.lang.Object
com.codename1.gaming.platformer.AIBrain.TargetWithin
- All Implemented Interfaces:
AIBrain.Decision
- Enclosing class:
AIBrain
Holds when the player is within a distance, and optionally in front.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandecide(AIBrain brain, Actor self, PlatformWorld world) Whether the transition should fire.
-
Constructor Details
-
TargetWithin
public TargetWithin(int range, boolean inFront) A range check.
Parameters
range: the distance, fixed point, measured on each axisinFront: whether the player must also be on the facing side
-
-
Method Details
-
decide
Description copied from interface:AIBrain.DecisionWhether the transition should fire.
Parameters
brain: the brainself: the actorworld: the world
Returns
true to switch
- Specified by:
decidein interfaceAIBrain.Decision
-