In general: Everything that can be handled by the PhysicsEngine
(accessed via Game.getPhysicsEngine()
) can participate in a collision process. Now, that being said, we provide basic implementations that already implement ICollisionEntity
(e.g. Creature
) and if you move such entities using Game.getPhysicsEngine().move(...)
, the movement will respect all static CollisionBoxes
and other entities that have collision enabled.
If you add a CollisionBox
or an entity that implements ICollisionEntiy
to your Environment
, it will automatically be known by the PhysicsEngine
.
Example from the MovementController
:
Point2D newLocation = new Point2D.Double(this.getEntity().getX() + dX, this.getEntity().getY() + dY);
Game.getPhysicsEngine().move(this.getEntity(), newLocation);
I've created Issue 195 to provide a proper documentation about the PhysicsEngine
and the related workflows.