Technical reference page for the Ballistica line-of-sight and pathfinding system.
File: `RemixedDungeon/src/main/java/com/watabou/pixeldungeon/mechanics/Ballistica.java`
Class: `com.watabou.pixeldungeon.mechanics.Ballistica`
cast(int from, int to, boolean magic, boolean hitChars)
cast(int from, int to, boolean magic, boolean hitChars, boolean hitObjects)
getBacktraceCell(int distFromEnd)
The Ballistica system uses Bresenham's line algorithm for path calculation:
1. Calculate starting (x0, y0) and target (x1, y1) coordinates 2. Determine step direction for X and Y axes 3. Use major/minor axis stepping with error accumulation 4. Trace cells until target is reached or obstacle is encountered 5. Store each cell in the trace array
Ballistica is used by:
The `getBacktraceCell` method is exposed to Lua via @LuaInterface annotation for scripting support.