|
AI for Games 1.1.1
|

Public Member Functions | |
| Obstacle (String name, Vector2D pos, double colRadius) | |
| Obstacle (Vector2D pos, double colRadius) | |
| boolean | isEitherSide (double x0, double y0, double x1, double y1) |
| boolean | isInDomain (Domain view) |
| boolean | isOver (double px, double py) |
| String | toString () |
Public Member Functions inherited from game2dai.entities.BaseEntity | |
| BaseEntity () | |
| BaseEntity (String name) | |
| BaseEntity (String entityName, Vector2D entityPos, double entityColRadius) | |
| int | ID () |
| void | updateFSM (double deltaTime, World world) |
| FiniteStateMachine | FSM () |
| boolean | hasFSM () |
| void | addFSM () |
| boolean | removeFSM () |
| int | Z () |
| BaseEntity | Z (int z) |
| boolean | isVisible () |
| BaseEntity | visible (boolean visible) |
| double | colRadius () |
| BaseEntity | colRadius (double colRadius) |
| boolean | isOverLapAllowed () |
| BaseEntity | overLapAllowed (boolean overLapAllowed) |
| boolean | isInDomain (Domain view) |
| boolean | isOver (double px, double py) |
| BaseEntity | renderer (Picture renderer) |
| Picture | renderer () |
| void | die (World world, double timeToLive) |
| void | born (World world, double timeToLive) |
| BaseEntity | moveTo (double x, double y) |
| BaseEntity | moveTo (Vector2D p) |
| BaseEntity | moveBy (double x, double y) |
| BaseEntity | moveBy (Vector2D p) |
| Vector2D | pos () |
| BaseEntity | name (String name) |
| String | name () |
| boolean | isEitherSide (double x0, double y0, double x1, double y1) |
| boolean | isEitherSide (Vector2D p0, Vector2D p1) |
| void | update (double deltaTime, World world) |
| void | draw (World world) |
| void | draw (double elapsedTime, World world) |
| int | compareTo (BaseEntity o) |
| String | toString () |
Static Public Member Functions | |
| static Obstacle[] | makeFromXML (PApplet app, String xmlFilename) |
| static Obstacle[] | makeFromXML (String xmlFilename) |
| static Obstacle[] | makeFromXML (File xmlFile) |
Additional Inherited Members | |
Public Attributes inherited from game2dai.entities.BaseEntity | |
| String | tag = "" |
| int | tagNo = 0 |
Protected Attributes inherited from game2dai.entities.BaseEntity | |
| Integer | entityID |
| String | name = "" |
| Picture | renderer = null |
| boolean | visible = true |
| Vector2D | pos = new Vector2D() |
| double | colRadius |
Package Attributes inherited from game2dai.entities.BaseEntity | |
| boolean | overlapAllowed = false |
This class represents a circular obstacle. The user must ensure that the collision radius and the obstacles renderer size are appropriately matched.
| game2dai.entities.Obstacle.Obstacle | ( | String | name, |
| Vector2D | pos, | ||
| double | colRadius | ||
| ) |
Create an obstacle with a name
| name | optional name for this obstacle |
| pos | world position of obstacle centre |
| colRadius | collision radius |
| game2dai.entities.Obstacle.Obstacle | ( | Vector2D | pos, |
| double | colRadius | ||
| ) |
Create an obstacle without a name
| pos | world position of obstacle centre |
| colRadius | collision radius |
| boolean game2dai.entities.Obstacle.isEitherSide | ( | double | x0, |
| double | y0, | ||
| double | x1, | ||
| double | y1 | ||
| ) |
Determines whether two points are either side of this obstacle. If they are then they cannot 'see' each other.
| x0 | x position of first point of interest |
| y0 | y position of first point of interest |
| x1 | x position of second point of interest |
| y1 | y position of second point of interest |
Reimplemented from game2dai.entities.BaseEntity.
| boolean game2dai.entities.Obstacle.isInDomain | ( | Domain | view | ) |
Determine whether this obstacle is inside or part inside the domain. This method is used by the world draw method to see if this entity should be drawn.
| view | the world domain |
Reimplemented from game2dai.entities.BaseEntity.
| boolean game2dai.entities.Obstacle.isOver | ( | double | px, |
| double | py | ||
| ) |
Determine whether the given world position is over this obstacle.
| px | x position for point of interest |
| py | y position for point of interest |
Reimplemented from game2dai.entities.BaseEntity.
|
static |
Alternative if not using Processing
| xmlFile | File to parse |
|
static |
This is the one to use with Processing
| app | |
| xmlFilename |
|
static |
Alternative if not using Processing
| xmlFilename | name of the file to parse |
| String game2dai.entities.Obstacle.toString | ( | ) |
Entity ID number and name returned as a String
Reimplemented from game2dai.entities.BaseEntity.