I’m building a simple Java app for an RTS game. The level/map is constructed using a 2D array like so…
objectsInWorld[3][numberOfObjects]
oIW[0][i] = x position of object i
oIW[1][i] = y position of object i
oIW[2][i] = size of object i
Each of the objects in the array can be a certain type. For example, some represent buildings, and some represent units/people. Is there a way to find a path between location [x1][y1] and [x2][y2], where the path does not intersect with certain objects in the array (such as a building at [x3][y3])?
Here’s a really good guide on pathfinding. You may find what you want here.
http://theory.stanford.edu/~amitp/GameProgramming/index.html