AI for Games 1.1.1
|
Public Member Functions | |
Picture () | |
void | draw (BaseEntity owner, float posX, float posY, float velX, float velY, float headX, float headY) |
void | draw (BaseEntity owner, float posX, float posY, float velX, float velY, float headX, float headY, float elapsedTime) |
void | showHints (int hints) |
void | addHints (int hints) |
void | removeHints (int hints) |
void | removeAllHints () |
int | getHints () |
Protected Attributes | |
int | hints = 0 |
Any class to be used to render an entity on the screen should inherit from this class.
It provides a simple way to display steering behaviour hints for any entity renderer. This is particularly useful when it comes to testing your steering behaviours.
Hints available are
HINT_HEADING the direction the entity is facing
HINT_VELOCITY the velocity vector
HINT_COLLISION the collision radius
HINT_WHISKERS the feelers used in wall avoidance
HINT_OBS_AVOID the detection box used in obstacle avoidance
HINT_WANDER the wander direction and circle
HINT_VIEW the area that can be seen by the entity
When setting the hints to be shown they can be or'ed together e.g. Hints.HINT_HEADING | hints.HINT_VELOCITY
game2dai.entityshapes.Picture.Picture | ( | ) |
This constructor is provided when not using Processing.
void game2dai.entityshapes.Picture.addHints | ( | int | hints | ) |
Add more steering behaviour (SB) hints to those already selected.
hints |
void game2dai.entityshapes.Picture.draw | ( | BaseEntity | owner, |
float | posX, | ||
float | posY, | ||
float | velX, | ||
float | velY, | ||
float | headX, | ||
float | headY | ||
) |
DO NOT USE THIS METHOD
This method is left to ensure backward compatibility with library versions prior to 1.0
Use the draw method with the extra parameter for elapsed time.
void game2dai.entityshapes.Picture.draw | ( | BaseEntity | owner, |
float | posX, | ||
float | posY, | ||
float | velX, | ||
float | velY, | ||
float | headX, | ||
float | headY, | ||
float | elapsedTime | ||
) |
This method must be overridden in all child classes otherwise nothing is drawn.
This version of the draw method has an additional parameter for the elpased time since last update and will be called will be called by the
owner | the entity that owns this renderer. |
posX | real world position (x) |
posY | real world position (x) |
velX | magnitude of the velocity vector in the x direction |
velY | magnitude of the velocity vector in the y direction |
headX | magnitude of the heading vector in the x direction |
headY | magnitude of the heading vector in the y direction |
etime | the elapsed time in seconds since last update |
Reimplemented in game2dai.entityshapes.ps.ArrowPic, game2dai.entityshapes.ps.BitmapPic, game2dai.entityshapes.ps.BuildingPic, game2dai.entityshapes.ps.CirclePic, game2dai.entityshapes.ps.ObstaclePic, game2dai.entityshapes.ps.PersonPic, game2dai.entityshapes.ps.Umbrella, and game2dai.entityshapes.ps.WallPic.
int game2dai.entityshapes.Picture.getHints | ( | ) |
Get the hints being currently used.
void game2dai.entityshapes.Picture.removeAllHints | ( | ) |
Remove all steering behaviour (SB) hints.
void game2dai.entityshapes.Picture.removeHints | ( | int | hints | ) |
Remove some or all of the steering behaviour (SB) hints currently selected.
hints |
void game2dai.entityshapes.Picture.showHints | ( | int | hints | ) |
Defines the steering behaviour (SB) hints to be displayed.
Although you can specify any and all hints, only hints for SBs currently in use will be displayed.
This method replaces any existing SB hints.
hints |
|
protected |
bit flag defining hints to be displayed