Bandidos
|
Public Member Functions | |
BaseEnemyAIComponent (Playfield playfield, float movementSpeed, String[] unwalkableTags) | |
void | setSideStepChance (int percentage) |
int | getSideStepChance () |
void | awake () |
Public Member Functions inherited from com.mygdx.game.components.BaseGridNavigationComponent | |
BaseGridNavigationComponent (Grid grid, String gridOccupyTag, int xSize, int ySize) | |
void | addUnwalkableOccupyTag (String tag) |
boolean | hasUnwalkableOccupyTag (String tag) |
void | removeUnwalkableOccupyTag (String tag) |
Public Member Functions inherited from com.mygdx.game.components.GridUserComponent | |
GridUserComponent (Grid grid, String gridOccupyTag, int xSize, int ySize) | |
GridUserComponent (Grid grid, String[] gridOccupyTags, int xSize, int ySize) | |
GridTile | getCurrentLocatedTile () |
boolean | isLocated () |
int | getLocationX () |
int | getLocationY () |
void | placeSelfOnLocation (int x, int y) |
void | removeSelfFromLocation () |
Collection< String > | getGridOccupyTags () |
void | addGridOccupyTag (String tag) |
void | removeGridOccupyTag (String tag) |
boolean | hasGridOccupyTag (String tag) |
void | awake () |
Public Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent | |
EngineTween | startTweenOnComponent (Tween tween, TweenStartType tweenStartType) |
Timeline | startTimelineOnComponent (Timeline timeline, boolean updateInGameTime) |
EngineTween | doFloat (TweenableFloat floatToTween, float newValue, float duration, TweenStartType tweenStartType) |
void | stopAllComponentTweens () |
void | initialize (BaseEntity parentEntity) |
BaseEntity | getParentOfComponent () |
boolean | isActive () |
boolean | isDestroyed () |
void | setActiveState (boolean activeState) |
void | destroy () |
void | update (float deltaTime) |
abstract void | awake () |
Public Member Functions inherited from com.mygdx.game.engine.events.EventDispatcher | |
void | addEventListener (String type, IEventReceiver listeningClass) |
void | dispatchEvent (Event event) |
void | removeEventListener (String type, IEventReceiver listener) |
boolean | hasEventListener (String type) |
ArrayList< ListenerItem > | getAllListeners () |
void | destroyAllListeners () |
void | clean () |
Protected Member Functions | |
void | destroyed () |
float | getMovementSpeed () |
Playfield | getPlayfield () |
Enemy | getAffectedEnemy () |
void | moveToPlayerBase (int yRowToStop) |
Protected Member Functions inherited from com.mygdx.game.components.BaseGridNavigationComponent | |
Vector2 | getNewTargetTile (float sideStepChance) |
Vector2 | getSideStep () |
Vector2 | getTargetPosition () |
boolean | canWalkOnTile (int tileX, int tileY) |
Vector2 | getWalkableTileOnRow (int yRow) |
boolean | hasAnyUnwalkableOccupyTag (GridTile tile) |
Protected Member Functions inherited from com.mygdx.game.components.GridUserComponent | |
Grid | getGrid () |
void | destroyed () |
void | updated (float deltaTime) |
void | activeStateChanged () |
Protected Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent | |
abstract void | updated (float deltaTime) |
abstract void | destroyed () |
abstract void | activeStateChanged () |
Additional Inherited Members | |
Static Public Attributes inherited from com.mygdx.game.components.GridUserComponent | |
static final int | NOT_LOCATED_VALUE = -1337 |
This is the Base class for all the AI Components. This component holds info on the field and handles navigation to the player base. NOTE: This Component can only be attached to an entity of the class 'Enemy', else this component will give a runtime error.
com.mygdx.game.components.BaseEnemyAIComponent.BaseEnemyAIComponent | ( | Playfield | playfield, |
float | movementSpeed, | ||
String [] | unwalkableTags | ||
) |
Setting up the AI requires the following components (Use the method 'setSideStepChance' to also set the chance of the AI performing a side step action)
playfield | on which the AI will interact with |
movementSpeed | with which speed the AI will move the Enemy Body |
unwalkableTags | are tags this particular AI instance can't walk over (A.k.a. will avoid) |
void com.mygdx.game.components.BaseEnemyAIComponent.awake | ( | ) |
|
protected |
|
protected |
Returns the Enemy which this component is attached to
|
protected |
Returns the movement speed set for this AI Component.
|
protected |
Returns the Playfield which was given to this component to be orientated on.
int com.mygdx.game.components.BaseEnemyAIComponent.getSideStepChance | ( | ) |
Gets the chance of this AI choosing to try a side step
|
protected |
This method will cause the enemy this component is attached to, to move up until the given y row to stop moving. (Moving downwards) NOTE: This should be called every frame in order to keep processing.
yRowToStop | is the Y row in grid space to stop moving. |
void com.mygdx.game.components.BaseEnemyAIComponent.setSideStepChance | ( | int | percentage | ) |
Sets the chance of this AI choosing to try a side step. (value between 0 - 100)
percentage | between 0 and 100. |