Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ============================================================================
- // [Dusk] AproxDistance: Doom's P_AproxDistance, converted to ACS.
- // It's faster, but less accurate than distance().
- function int AproxDistance (int t1, int t2) {
- int dx = abs (GetActorX (t1) - GetActorX (t2));
- int dy = abs (GetActorY (t1) - GetActorY (t2));
- if (dx < dy)
- return dy + (dx / 2);
- return dx + (dy / 2);
- }
Advertisement
Add Comment
Please, Sign In to add comment