Add support for dynamic collision detection

This commit implements collision detection using the map files loaded
from the cache, and adds support for modifying the collision matrices at
runtime when the game world is updated.

All checks to see if a tile is reachable should now be done via.
World#traversable, instead of Region#traversable, as the World object
can handle checking tiles across multiple regions.  These are done for
the WalkingQueue and Pathfinder implementations.
This commit is contained in:
Gary Tierney
2016-12-31 00:55:00 +00:00
parent 0672fa2ea0
commit 6188c2e751
19 changed files with 1380 additions and 639 deletions
+14
View File
@@ -40,6 +40,20 @@ public final class MapObject {
this.orientation = orientation;
}
/**
* Create a new {@code MapObject}.
*
* @param id The object ID of this map object.
* @param x The local X coordinate of this object.
* @param y The local Y coordinate of this object.
* @param height The height level of this object.
* @param type The type of this object.
* @param orientation The orientation of this object.
*/
public MapObject(int id, int x, int y, int height, int type, int orientation) {
this(id, (height & 0x3f) << 12 | (x & 0x3f) << 6 | (y & 0x3f), type, orientation);
}
/**
* Get the object ID of this map object.
*