Physics Engine
Class for calculating and performing physical operations with entities.
All entities exist on a 2D grid of their units, which represents a single level.
The supported operations are performing movements, detecting collisions, checking if paths are obstructed and so on.
Parameters
w
Width of level.
h
Height of level.
Constructors
Types
Functions
Link copied to clipboard
final Boolean checkPathAvailability(Paths2D.PathStrategy path, Cell startCell, Integer depth, Function1<GameUnit, Boolean> unitIsOk, Function1<GameUnit, Boolean> unitIsTarget)
Content copied to clipboard
Checks if all cells on path are available.
Link copied to clipboard
Generate a random cell in bounds of this grid which is not occupied by entity.
Link copied to clipboard
Removes the entity from this PhysicsEngine grid.
Link copied to clipboard
Removes the units (of the same entity) from this PhysicsEngine grid.
Link copied to clipboard
Tries to move an existing GameEntity in the specified Direction by one Cell.
Link copied to clipboard
Tries to add the entity to this PhysicsEngine grid.