Entity is the base class for all entity classes.
Create a new entity
world |
an instance of EntityManager |
position |
an instance of RealVector2D |
radius |
radius in meters |
mass |
a number/float |
collisionType |
a symbol for the collision type /free, /mobile or /static |
an Entity
Attach a representation to the entity.
Returns true if the entity is colliding and false if it is not.
Dettach a representation.
Set the collision function. The function is passed in the current entity and an array containing the colliding entities.
Add the entity to the manager. Usually we let this happen automatically the moment we attach the first representation. The entity is going to be added synchronously with the first attached representation.
Get the EntityManager
Detach all representations.
Remove the entity. This will remove all the attached representations.
Check if the entity is active aka. has been added to the manager.